Issue #16719: Get rid of WindowsError. Use OSError instead

Patch by Serhiy Storchaka.
This commit is contained in:
Andrew Svetlov 2012-12-19 14:33:35 +02:00
parent 8a045cb93b
commit 2606a6f197
28 changed files with 79 additions and 87 deletions

View file

@ -331,7 +331,7 @@ def lexists(path):
"""Test whether a path exists. Returns True for broken symbolic links"""
try:
st = os.lstat(path)
except (OSError, WindowsError):
except OSError:
return False
return True
@ -584,7 +584,7 @@ else: # use native Windows method on Windows
if path: # Empty path must return current working directory.
try:
path = _getfullpathname(path)
except WindowsError:
except OSError:
pass # Bad path - return unchanged.
elif isinstance(path, bytes):
path = os.getcwdb()