summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-03-08 14:12:46 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-03-08 14:12:46 (GMT)
commit238fecd75cf79aa835d4e9e310be44a295698340 (patch)
treef0db89c2c199168b2dc859d10443f2e28b5d196f /Lib/test
parent3a5e1afb922fb8438f19345ae858515b20d6fd43 (diff)
parent55e3218eee49260a68de9c5a85549e1c719038ca (diff)
downloadcpython-238fecd75cf79aa835d4e9e310be44a295698340.zip
cpython-238fecd75cf79aa835d4e9e310be44a295698340.tar.gz
cpython-238fecd75cf79aa835d4e9e310be44a295698340.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/test')
-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 07682f2..3ad21a1 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -836,7 +836,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"])