mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Issue #16706: get rid of os.error
This commit is contained in:
parent
a191959849
commit
ad28c7f9da
33 changed files with 4089 additions and 4123 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue