summaryrefslogtreecommitdiff
path: root/Lib/ntpath.py
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2012-12-19 14:33:35 +0200
committerAndrew Svetlov <andrew.svetlov@gmail.com>2012-12-19 14:33:35 +0200
commit2606a6f197a49f04611cb5cb0d67404d1ab14481 (patch)
tree35c228625105050ec2f593e6b362ce9e2498c760 /Lib/ntpath.py
parent8a045cb93bded97220422a957941bb68341429d1 (diff)
downloadcpython-git-2606a6f197a49f04611cb5cb0d67404d1ab14481.tar.gz
Issue #16719: Get rid of WindowsError. Use OSError instead
Patch by Serhiy Storchaka.
Diffstat (limited to 'Lib/ntpath.py')
-rw-r--r--Lib/ntpath.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/ntpath.py b/Lib/ntpath.py
index 12494c5fb5..2fbb6d69dd 100644
--- a/Lib/ntpath.py
+++ b/Lib/ntpath.py
@@ -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()