summaryrefslogtreecommitdiff
path: root/apt/cache.py
diff options
context:
space:
mode:
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