diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-03-08 14:12:09 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-03-08 14:12:09 (GMT) |
commit | 55e3218eee49260a68de9c5a85549e1c719038ca (patch) | |
tree | 57b323cc6f993db61d7f011cec45809edff11d54 /Lib | |
parent | f4d97ce1008e2f27c9b9ca636434d35d42098a2c (diff) | |
parent | 388b90f28e029daaf06aae8026b596e2f20a1cd3 (diff) | |
download | cpython-55e3218eee49260a68de9c5a85549e1c719038ca.zip cpython-55e3218eee49260a68de9c5a85549e1c719038ca.tar.gz cpython-55e3218eee49260a68de9c5a85549e1c719038ca.tar.bz2 |
Issues #23808, #25911: Trying to fix walk tests on Windows.
On Windows a symlink can has the FILE_ATTRIBUTE_DIRECTORY flag.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_os.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 73db39c..78db034 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -837,7 +837,11 @@ class WalkTests(unittest.TestCase): if support.can_symlink(): os.symlink(os.path.abspath(t2_path), self.link_path) os.symlink('broken', broken_link_path, True) - self.sub2_tree = (sub2_path, ["link"], ["broken_link", "tmp3"]) + if os.path.isdir(broken_link_path): + # On Windows a symlink can has the FILE_ATTRIBUTE_DIRECTORY flag. + self.sub2_tree = (sub2_path, ["broken_link", "link"], ["tmp3"]) + else: + self.sub2_tree = (sub2_path, ["link"], ["broken_link", "tmp3"]) else: self.sub2_tree = (sub2_path, [], ["tmp3"]) |