diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-01-10 18:08:13 +0100 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2011-01-10 18:08:13 +0100 |
| commit | 660c5bbf9d2793a392572e1c23eb36b4e9298792 (patch) | |
| tree | a74476633321630911690e7f513869efe5026132 /apt | |
| parent | b221e38a33871bc7040e457051c38ef222e618e5 (diff) | |
| download | python-apt-660c5bbf9d2793a392572e1c23eb36b4e9298792.tar.gz | |
merged lp:~geser/ubuntu/natty/python-apt/build-with-py3.2 (manually as bzr thinks the branches have nothing in common)
Diffstat (limited to 'apt')
| -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 |
5 files changed, 8 insertions, 8 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) |
