(original) (raw)

changeset: 100455:f9e22717722d branch: 3.5 parent: 100450:0628189fe42b parent: 100454:19a3e0e664af user: Serhiy Storchaka storchaka@gmail.com date: Tue Mar 08 16:12:09 2016 +0200 files: Lib/test/test_os.py description: Issues #23808, #25911: Trying to fix walk tests on Windows. On Windows a symlink can has the FILE_ATTRIBUTE_DIRECTORY flag. diff -r 0628189fe42b -r f9e22717722d Lib/test/test_os.py --- a/Lib/test/test_os.py Tue Mar 08 01:09:08 2016 -0500 +++ b/Lib/test/test_os.py Tue Mar 08 16:12:09 2016 +0200 @@ -837,7 +837,11 @@ 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"]) /storchaka@gmail.com