diff options
| author | Julian Andres Klode <jak@debian.org> | 2010-01-23 16:19:27 +0100 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2010-01-23 16:19:27 +0100 |
| commit | e29ff27343b203fd4150d6171efdc7e6ae5a68bf (patch) | |
| tree | 4a678ae9374cbedd7243d2c673d56282505cfbb0 | |
| parent | 511ca4dd916413a5f6a0ae140cfc678695bb006f (diff) | |
| download | python-apt-e29ff27343b203fd4150d6171efdc7e6ae5a68bf.tar.gz | |
apt/cache.py: Fix Cache.update() to not raise errors on successful updates.
| -rw-r--r-- | apt/cache.py | 11 | ||||
| -rw-r--r-- | debian/changelog | 2 |
2 files changed, 8 insertions, 5 deletions
diff --git a/apt/cache.py b/apt/cache.py index 2f097f6b..2a62ddce 100644 --- a/apt/cache.py +++ b/apt/cache.py @@ -307,11 +307,12 @@ class Cache(object): try: if fetch_progress is None: fetch_progress = apt.progress.FetchProgress() - res = self._cache.update(fetch_progress, self._list, - pulse_interval) - if res == apt_pkg.Acquire.RESULT_CANCELLED and raise_on_error: - raise FetchCancelledException() - if res == apt_pkg.Acquire.RESULT_FAILED and raise_on_error: + try: + res = self._cache.update(fetch_progress, self._list, + pulse_interval) + except SystemError, e: + raise FetchFailedException(e) + if not res and raise_on_error: raise FetchFailedException() else: return res diff --git a/debian/changelog b/debian/changelog index 6f5cd696..95ca5b41 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ python-apt (0.7.93.1) UNRELEASED; urgency=low * Fix reference counting for old progress classes (Closes: #566370). + * apt/cache.py: + - Fix Cache.update() to not raise errors on successful updates. -- Julian Andres Klode <jak@debian.org> Sat, 23 Jan 2010 15:35:55 +0100 |
