summaryrefslogtreecommitdiffstats
path: root/Lib/tempfile.py
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2012-12-18 20:02:39 (GMT)
committerAndrew Svetlov <andrew.svetlov@gmail.com>2012-12-18 20:02:39 (GMT)
commitad28c7f9dad791567afa0624acfb3ba430851965 (patch)
tree02095e5f567d6be1de31ffd858d21233b51675dd /Lib/tempfile.py
parenta19195984922ce89e7695c93b3bb45c3e0e6d732 (diff)
downloadcpython-ad28c7f9dad791567afa0624acfb3ba430851965.zip
cpython-ad28c7f9dad791567afa0624acfb3ba430851965.tar.gz
cpython-ad28c7f9dad791567afa0624acfb3ba430851965.tar.bz2
Issue #16706: get rid of os.error
Diffstat (limited to 'Lib/tempfile.py')
-rw-r--r--Lib/tempfile.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/tempfile.py b/Lib/tempfile.py
index 47c60f4..90b3c20 100644
--- a/Lib/tempfile.py
+++ b/Lib/tempfile.py
@@ -665,7 +665,6 @@ class TemporaryDirectory(object):
_islink = staticmethod(_os.path.islink)
_remove = staticmethod(_os.remove)
_rmdir = staticmethod(_os.rmdir)
- _os_error = OSError
_warn = _warnings.warn
def _rmtree(self, path):
@@ -675,16 +674,16 @@ class TemporaryDirectory(object):
fullname = self._path_join(path, name)
try:
isdir = self._isdir(fullname) and not self._islink(fullname)
- except self._os_error:
+ except OSError:
isdir = False
if isdir:
self._rmtree(fullname)
else:
try:
self._remove(fullname)
- except self._os_error:
+ except OSError:
pass
try:
self._rmdir(path)
- except self._os_error:
+ except OSError:
pass