summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-03-08 14:11:26 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-03-08 14:11:26 (GMT)
commit388b90f28e029daaf06aae8026b596e2f20a1cd3 (patch)
treed76502684625f2668c3cb0c88dd5958e2dbff6c8
parentf11b25b0813a1c07ddf55cca1512ef65eb97a636 (diff)
downloadcpython-388b90f28e029daaf06aae8026b596e2f20a1cd3.zip
cpython-388b90f28e029daaf06aae8026b596e2f20a1cd3.tar.gz
cpython-388b90f28e029daaf06aae8026b596e2f20a1cd3.tar.bz2
Issues #23808, #25911: Trying to fix walk tests on Windows.
On Windows a symlink can has the FILE_ATTRIBUTE_DIRECTORY flag.
-rw-r--r--Lib/test/test_os.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index e29b0d5..c5f5937 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -770,7 +770,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"])