From e29ff27343b203fd4150d6171efdc7e6ae5a68bf Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sat, 23 Jan 2010 16:19:27 +0100 Subject: apt/cache.py: Fix Cache.update() to not raise errors on successful updates. --- apt/cache.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'apt') 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 -- cgit v1.2.3