summaryrefslogtreecommitdiffstats
path: root/Lib/os.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-10-25 11:34:38 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-10-25 11:34:38 (GMT)
commitaf4e4747f5e32ec60dbc98fdbeb9681bf3fafe64 (patch)
tree1b7ff49a9011fed33ec5d9aedd5615a68618ca48 /Lib/os.py
parent179111bd22c1e713c5e026b37300be0c63d4c204 (diff)
parent42bababba62023383291c7413a5d453374ecd933 (diff)
downloadcpython-af4e4747f5e32ec60dbc98fdbeb9681bf3fafe64.zip
cpython-af4e4747f5e32ec60dbc98fdbeb9681bf3fafe64.tar.gz
cpython-af4e4747f5e32ec60dbc98fdbeb9681bf3fafe64.tar.bz2
Issue #28353: os.fwalk() no longer fails on broken links.
Diffstat (limited to 'Lib/os.py')
-rw-r--r--Lib/os.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/os.py b/Lib/os.py
index 0c9107c..71ed088 100644
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -481,13 +481,13 @@ if {open, stat} <= supports_dir_fd and {listdir, stat} <= supports_fd:
dirs.append(name)
else:
nondirs.append(name)
- except FileNotFoundError:
+ except OSError:
try:
# Add dangling symlinks, ignore disappeared files
if st.S_ISLNK(stat(name, dir_fd=topfd, follow_symlinks=False)
.st_mode):
nondirs.append(name)
- except FileNotFoundError:
+ except OSError:
continue
if topdown: