summaryrefslogtreecommitdiff
path: root/apt/cache.py
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2010-01-23 16:19:27 +0100
committerJulian Andres Klode <jak@debian.org>2010-01-23 16:19:27 +0100
commite29ff27343b203fd4150d6171efdc7e6ae5a68bf (patch)
tree4a678ae9374cbedd7243d2c673d56282505cfbb0 /apt/cache.py
parent511ca4dd916413a5f6a0ae140cfc678695bb006f (diff)
downloadpython-apt-e29ff27343b203fd4150d6171efdc7e6ae5a68bf.tar.gz
apt/cache.py: Fix Cache.update() to not raise errors on successful updates.
Diffstat (limited to 'apt/cache.py')
-rw-r--r--apt/cache.py11
1 files changed, 6 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