Skip to content

Commit 0a4593d

Browse files
committed
Fix PureWindowsPath separators for Pythons < 3.12
Related to #1006
1 parent 2c8ec63 commit 0a4593d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pyfakefs/fake_pathlib.py

+7
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,13 @@ class _FakeWindowsFlavour(_FakeFlavour):
392392
)
393393
pathmod = ntpath
394394

395+
def __init__(self, *args, **kwargs):
396+
super().__init__(*args, **kwargs)
397+
# Because this class is used with pure Windows paths,
398+
# the separators must be filesystem-independent.
399+
self.sep = "\\"
400+
self.altsep = "/"
401+
395402
def is_reserved(self, parts):
396403
"""Return True if the path is considered reserved under Windows."""
397404

0 commit comments

Comments
 (0)