Mercurial > cpython-lru_cache-weakref
diff Lib/shutil.py @ 71828:552efc3eb45c
Remove unused names in except clauses
| author | Éric Araujo <merwok@netwok.org> |
|---|---|
| date | Wed, 10 Aug 2011 20:54:33 +0200 |
| parents | f1e761dea2ee |
| children | fa48107b2d8a |
line wrap: on
line diff
--- a/Lib/shutil.py Wed Aug 10 02:46:33 2011 +0200 +++ b/Lib/shutil.py Wed Aug 10 20:54:33 2011 +0200 @@ -267,7 +267,7 @@ names = [] try: names = os.listdir(path) - except os.error as err: + except os.error: onerror(os.listdir, path, sys.exc_info()) for name in names: fullname = os.path.join(path, name) @@ -280,7 +280,7 @@ else: try: os.remove(fullname) - except os.error as err: + except os.error: onerror(os.remove, fullname, sys.exc_info()) try: os.rmdir(path) @@ -323,7 +323,7 @@ raise Error("Destination path '%s' already exists" % real_dst) try: os.rename(src, real_dst) - except OSError as exc: + except OSError: if os.path.isdir(src): if _destinsrc(src, dst): raise Error("Cannot move a directory '%s' into itself '%s'." % (src, dst))
