diff options
Diffstat (limited to 'Lib/tarfile.py')
-rw-r--r-- | Lib/tarfile.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py index 3ffdff3..2088e5c 100644 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py @@ -1540,7 +1540,7 @@ class TarFile(object): self.chown(tarinfo, path) self.utime(tarinfo, path) self.chmod(tarinfo, path) - except ExtractError, e: + except ExtractError as e: if self.errorlevel > 1: raise else: @@ -1565,7 +1565,7 @@ class TarFile(object): try: self._extract_member(tarinfo, os.path.join(path, tarinfo.name)) - except EnvironmentError, e: + except EnvironmentError as e: if self.errorlevel > 0: raise else: @@ -1573,7 +1573,7 @@ class TarFile(object): self._dbg(1, "tarfile: %s" % e.strerror) else: self._dbg(1, "tarfile: %s %r" % (e.strerror, e.filename)) - except ExtractError, e: + except ExtractError as e: if self.errorlevel > 1: raise else: @@ -1681,7 +1681,7 @@ class TarFile(object): """ try: os.mkdir(targetpath) - except EnvironmentError, e: + except EnvironmentError as e: if e.errno != errno.EEXIST: raise @@ -1745,11 +1745,11 @@ class TarFile(object): try: self._extract_member(self.getmember(linkpath), targetpath) - except (EnvironmentError, KeyError), e: + except (EnvironmentError, KeyError) as e: linkpath = os.path.normpath(linkpath) try: shutil.copy2(linkpath, targetpath) - except EnvironmentError, e: + except EnvironmentError as e: raise IOError("link could not be created") def chown(self, tarinfo, targetpath): @@ -1777,7 +1777,7 @@ class TarFile(object): else: if sys.platform != "os2emx": os.chown(targetpath, u, g) - except EnvironmentError, e: + except EnvironmentError as e: raise ExtractError("could not change owner") def chmod(self, tarinfo, targetpath): @@ -1786,7 +1786,7 @@ class TarFile(object): if hasattr(os, 'chmod'): try: os.chmod(targetpath, tarinfo.mode) - except EnvironmentError, e: + except EnvironmentError as e: raise ExtractError("could not change mode") def utime(self, tarinfo, targetpath): @@ -1800,7 +1800,7 @@ class TarFile(object): return try: os.utime(targetpath, (tarinfo.mtime, tarinfo.mtime)) - except EnvironmentError, e: + except EnvironmentError as e: raise ExtractError("could not change modification time") #-------------------------------------------------------------------------- @@ -1833,7 +1833,7 @@ class TarFile(object): tarinfo = self.proc_member(tarinfo) - except HeaderError, e: + except HeaderError as e: if self.ignore_zeros: self._dbg(2, "0x%X: %s" % (self.offset, e)) self.offset += BLOCKSIZE |