-
-
Save MorganRamsay/bae6dbd4415b2d78088607f0d7cc9941 to your computer and use it in GitHub Desktop.
Python 3.6.4: os.walk (lines 402-409 in os.py) - fixed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for dirname in dirs: | |
new_path = join(top, dirname) | |
# Issue #23605: os.path.islink() is used instead of caching | |
# entry.is_symlink() result during the loop on os.scandir() because | |
# the caller can replace the directory entry during the "yield" | |
# above. | |
if followlinks or not islink(new_path): | |
yield from walk(new_path, topdown, onerror, followlinks) | |
else: | |
yield new_path, None, None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment