summaryrefslogtreecommitdiffstats
path: root/Lib/os.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-10-25 11:28:38 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-10-25 11:28:38 (GMT)
commit42bababba62023383291c7413a5d453374ecd933 (patch)
tree72a1291a7ef660c580f4f02f3e835c064b12721f /Lib/os.py
parent036fb15435a2b5fb8acb200ee694b1d50c87a3a9 (diff)
downloadcpython-42bababba62023383291c7413a5d453374ecd933.zip
cpython-42bababba62023383291c7413a5d453374ecd933.tar.gz
cpython-42bababba62023383291c7413a5d453374ecd933.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 b4c651d..011285e 100644
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -537,13 +537,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: