mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #16719: Get rid of WindowsError. Use OSError instead
Patch by Serhiy Storchaka.
This commit is contained in:
parent
8a045cb93b
commit
2606a6f197
28 changed files with 79 additions and 87 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue