8000 Issues #23808, #25911: Trying to fix walk tests on Windows. · python/cpython@388b90f · GitHub
[go: up one dir, main page]

Skip to content

Commit 388b90f

Browse files
Issues #23808, #25911: Trying to fix walk tests on Windows.
On Windows a symlink can has the FILE_ATTRIBUTE_DIRECTORY flag.
1 parent f11b25b commit 388b90f

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
@@ -770,7 +770,11 @@ def setUp(self):
770770
if support.can_symlink():
771771
os.symlink(os.path.abspath(t2_path), self.link_path)
772772
os.symlink('broken', broken_link_path, True)
773-
self.sub2_tree = (sub2_path, ["link"], ["broken_link", "tmp3"])
773+
if os.path.isdir(broken_link_path):
774+
# On Windows a symlink can has the FILE_ATTRIBUTE_DIRECTORY flag.
775+
self.sub2_tree = (sub2_path, ["broken_link", "link"], ["tmp3"])
776+
else:
777+
self.sub2_tree = (sub2_path, ["link"], ["broken_link", "tmp3"])
774778
else:
775779
self.sub2_tree = (sub2_path, [], ["tmp3"])
776780

0 commit comments

Comments
 (0)
0