diff options
author | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-12-19 12:33:35 (GMT) |
---|---|---|
committer | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-12-19 12:33:35 (GMT) |
commit | 2606a6f197a49f04611cb5cb0d67404d1ab14481 (patch) | |
tree | 35c228625105050ec2f593e6b362ce9e2498c760 /Lib/shutil.py | |
parent | 8a045cb93bded97220422a957941bb68341429d1 (diff) | |
download | cpython-2606a6f197a49f04611cb5cb0d67404d1ab14481.zip cpython-2606a6f197a49f04611cb5cb0d67404d1ab14481.tar.gz cpython-2606a6f197a49f04611cb5cb0d67404d1ab14481.tar.bz2 |
Issue #16719: Get rid of WindowsError. Use OSError instead
Patch by Serhiy Storchaka.
Diffstat (limited to 'Lib/shutil.py')
-rw-r--r-- | Lib/shutil.py | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/Lib/shutil.py b/Lib/shutil.py index 9a79f85..b1e3017 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -60,11 +60,6 @@ class RegistryError(Exception): and unpacking registeries fails""" -try: - WindowsError -except NameError: - WindowsError = None - def copyfileobj(fsrc, fdst, length=16*1024): """copy data from file-like object fsrc to file-like object fdst""" while 1: @@ -334,10 +329,8 @@ def copytree(src, dst, symlinks=False, ignore=None, copy_function=copy2, try: copystat(src, dst) except OSError as why: - if WindowsError is not None and isinstance(why, WindowsError): - # Copying file access times may fail on Windows - pass - else: + # Copying file access times may fail on Windows + if why.winerror is None: errors.append((src, dst, str(why))) if errors: raise Error(errors) |