Skip to content

Commit

Permalink
Use posixpath.sep instead of os.sep to have consistent across OS rend…
Browse files Browse the repository at this point in the history
…ering
  • Loading branch information
yarikoptic committed Sep 3, 2024
1 parent 19397c0 commit 81e7a43
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/examplecode/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"""

import os
import posixpath


class DirectoryTree:
Expand Down Expand Up @@ -69,7 +69,9 @@ def _add_dictionary(

# We are dealing with a directory
else:
self._tree.append(f"{prefix}{connector} {entry.rstrip(os.sep)}{os.sep}")
self._tree.append(
f"{prefix}{connector} {entry.rstrip(posixpath.sep)}{posixpath.sep}"
)
prefix += (
self.PIPE_PREFIX if index != entries_count - 1 else self.SPACE_PREFIX
)
Expand Down

0 comments on commit 81e7a43

Please sign in to comment.