diff options
author | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-12-17 23:35:18 +0200 |
---|---|---|
committer | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-12-17 23:35:18 +0200 |
commit | 67edf8022e0dbb8e72cd48247adb0563fed6c30b (patch) | |
tree | 696895f7748bd5ecbbe62e1e7d29ed07b44d355b /Lib/shutil.py | |
parent | f575364e3c6c0777a54f436c530961d49ebc7ecb (diff) | |
download | cpython-67edf8022e0dbb8e72cd48247adb0563fed6c30b.tar.gz |
Get rig of EnvironmentError (#16705)
Diffstat (limited to 'Lib/shutil.py')
-rw-r--r-- | Lib/shutil.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/shutil.py b/Lib/shutil.py index 55b26222db..1eb4733351 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -39,20 +39,20 @@ __all__ = ["copyfileobj", "copyfile", "copymode", "copystat", "copy", "copy2", "ignore_patterns", "chown", "which"] # disk_usage is added later, if available on the platform -class Error(EnvironmentError): +class Error(OSError): pass class SameFileError(Error): """Raised when source and destination are the same file.""" -class SpecialFileError(EnvironmentError): +class SpecialFileError(OSError): """Raised when trying to do a kind of operation (e.g. copying) which is not supported on a special file (e.g. a named pipe)""" -class ExecError(EnvironmentError): +class ExecError(OSError): """Raised when a command could not be executed""" -class ReadError(EnvironmentError): +class ReadError(OSError): """Raised when an archive cannot be read""" class RegistryError(Exception): @@ -329,7 +329,7 @@ def copytree(src, dst, symlinks=False, ignore=None, copy_function=copy2, # continue with other files except Error as err: errors.extend(err.args[0]) - except EnvironmentError as why: + except OSError as why: errors.append((srcname, dstname, str(why))) try: copystat(src, dst) |