diff options
| -rw-r--r-- | apt/cache.py | 2 | ||||
| -rw-r--r-- | apt/debfile.py | 4 | ||||
| -rw-r--r-- | apt/package.py | 2 | ||||
| -rw-r--r-- | apt/progress/base.py | 6 | ||||
| -rw-r--r-- | apt/progress/gtk2.py | 2 | ||||
| -rw-r--r-- | debian/control | 2 | ||||
| -rw-r--r-- | doc/source/conf.py | 2 | ||||
| -rw-r--r-- | tests/old/lock.py | 2 | ||||
| -rwxr-xr-x | utils/migrate-0.8.py | 2 |
9 files changed, 12 insertions, 12 deletions
diff --git a/apt/cache.py b/apt/cache.py index 586df366..4b917236 100644 --- a/apt/cache.py +++ b/apt/cache.py @@ -360,7 +360,7 @@ class Cache(object): try: res = self._cache.update(fetch_progress, slist, pulse_interval) - except SystemError, e: + except SystemError as e: raise FetchFailedException(e) if not res and raise_on_error: raise FetchFailedException() diff --git a/apt/debfile.py b/apt/debfile.py index 996a4cb3..86fd221b 100644 --- a/apt/debfile.py +++ b/apt/debfile.py @@ -461,7 +461,7 @@ class DebPackage(object): for pkg in self._need_pkgs: try: self._cache[pkg].mark_install(from_user=False) - except SystemError, e: + except SystemError as e: self._failure_string = _("Cannot install '%s'") % pkg self._cache.clear() return False @@ -543,7 +543,7 @@ class DebPackage(object): # auto-convert to hex try: data = unicode(data, "utf-8") - except Exception, e: + except Exception as e: new_data = _("Automatically converted to printable ascii:\n") new_data += self.to_strish(data) return new_data diff --git a/apt/package.py b/apt/package.py index 475edb76..f16ac2a4 100644 --- a/apt/package.py +++ b/apt/package.py @@ -338,7 +338,7 @@ class Version(object): if not isinstance(dsc, unicode): # Only convert where needed (i.e. Python 2.X) dsc = unicode(dsc, "utf-8") - except UnicodeDecodeError, err: + except UnicodeDecodeError as err: return _("Invalid unicode in description for '%s' (%s). " "Please report.") % (self.package.name, err) diff --git a/apt/progress/base.py b/apt/progress/base.py index 6822b74a..97375431 100644 --- a/apt/progress/base.py +++ b/apt/progress/base.py @@ -211,7 +211,7 @@ class InstallProgress(object): """Update the interface.""" try: line = self.status_stream.readline() - except IOError, err: + except IOError as err: # resource temporarly unavailable is ignored if err.errno != errno.EAGAIN and err.errno != errno.EWOULDBLOCK: print err.strerror @@ -266,7 +266,7 @@ class InstallProgress(object): try: select.select([self.status_stream], [], [], self.select_timeout) - except select.error, (errno_, _errstr): + except select.error as (errno_, _errstr): if errno_ != errno.EINTR: raise @@ -275,7 +275,7 @@ class InstallProgress(object): (pid, res) = os.waitpid(self.child_pid, os.WNOHANG) if pid == self.child_pid: break - except OSError, err: + except OSError as err: if err.errno == errno.ECHILD: break if err.errno != errno.EINTR: diff --git a/apt/progress/gtk2.py b/apt/progress/gtk2.py index acb01eed..9137ef76 100644 --- a/apt/progress/gtk2.py +++ b/apt/progress/gtk2.py @@ -506,7 +506,7 @@ def _test(): apt_progress.show_terminal(True) try: cache.commit(apt_progress.acquire, apt_progress.install) - except Exception, exc: + except Exception as exc: print >> sys.stderr, "Exception happened:", exc if len(sys.argv) > 1: deb = DebPackage(sys.argv[1], cache) diff --git a/debian/control b/debian/control index 475827e7..bbfd652c 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: standard Maintainer: APT Development Team <deity@lists.debian.org> Uploaders: Michael Vogt <mvo@debian.org>, Julian Andres Klode <jak@debian.org> Standards-Version: 3.9.1 -XS-Python-Version: >= 2.5 +XS-Python-Version: >= 2.6 X-Python3-Version: >= 3.1 Build-Depends: apt-utils, debhelper (>= 7.3.5), diff --git a/doc/source/conf.py b/doc/source/conf.py index 18c8642e..8fbf2c11 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -26,7 +26,7 @@ if os.path.exists("../../build"): sys.path.insert(0, os.path.abspath(os.path.dirname(apt_pkg_path))) try: import apt_pkg - except ImportError, exc: + except ImportError as exc: # Not the correct version sys.stderr.write('W: Ignoring error %s\n' % exc) sys.path.pop(0) diff --git a/tests/old/lock.py b/tests/old/lock.py index d45b3964..f19d3e43 100644 --- a/tests/old/lock.py +++ b/tests/old/lock.py @@ -20,7 +20,7 @@ if __name__ == "__main__": if pid == 0: try: apt_pkg.PkgSystemLock() - except SystemError, s: + except SystemError as s: print "Can't get lock: (error text:\n%s)" % s sys.exit(0) diff --git a/utils/migrate-0.8.py b/utils/migrate-0.8.py index 9f7790f7..555257a9 100755 --- a/utils/migrate-0.8.py +++ b/utils/migrate-0.8.py @@ -202,7 +202,7 @@ def find_occurences(all_old, files): words = defaultdict(lambda: set()) try: node = ast.parse(open(fname, "rU").read(), fname) - except Exception, e: + except Exception as e: print >> sys.stderr, "Ignoring %s: %s" % (fname, e) continue for i in ast.walk(node): |
