Skip to content

Commit 238fecd

Browse files
Issues python#23808, python#25911: Trying to fix walk tests on Windows.
On Windows a symlink can has the FILE_ATTRIBUTE_DIRECTORY flag.
2 parents 3a5e1af + 55e3218 commit 238fecd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Lib/test/test_os.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,11 @@ def setUp(self):
836836
if support.can_symlink():
837837
os.symlink(os.path.abspath(t2_path), self.link_path)
838838
os.symlink('broken', broken_link_path, True)
839-
self.sub2_tree = (sub2_path, ["link"], ["broken_link", "tmp3"])
839+
if os.path.isdir(broken_link_path):
840+
# On Windows a symlink can has the FILE_ATTRIBUTE_DIRECTORY flag.
841+
self.sub2_tree = (sub2_path, ["broken_link", "link"], ["tmp3"])
842+
else:
843+
self.sub2_tree = (sub2_path, ["link"], ["broken_link", "tmp3"])
840844
else:
841845
self.sub2_tree = (sub2_path, [], ["tmp3"])
842846

0 commit comments

Comments
 (0)