Issues #23808, #25911: Trying to fix walk tests on Windows.

On Windows a symlink can has the FILE_ATTRIBUTE_DIRECTORY flag.
This commit is contained in:
Serhiy Storchaka 2016-03-08 16:12:46 +02:00
commit 238fecd75c
1 changed files with 5 additions and 1 deletions

View File

@ -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"])