Skip to content

Commit 81e7a43

Browse files
committed
Use posixpath.sep instead of os.sep to have consistent across OS rendering
1 parent 19397c0 commit 81e7a43

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tools/examplecode/example.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
88
"""
99

10-
import os
10+
import posixpath
1111

1212

1313
class DirectoryTree:
@@ -69,7 +69,9 @@ def _add_dictionary(
6969

7070
# We are dealing with a directory
7171
else:
72-
self._tree.append(f"{prefix}{connector} {entry.rstrip(os.sep)}{os.sep}")
72+
self._tree.append(
73+
f"{prefix}{connector} {entry.rstrip(posixpath.sep)}{posixpath.sep}"
74+
)
7375
prefix += (
7476
self.PIPE_PREFIX if index != entries_count - 1 else self.SPACE_PREFIX
7577
)

0 commit comments

Comments
 (0)