[entropy.client.package] catch InterruptError raised by fetch_abort functions

This commit is contained in:
Fabio Erculiani
2013-12-31 12:28:29 +01:00
parent 61f11deef9
commit 0346f74c1a
2 changed files with 6 additions and 4 deletions

View File

@@ -18,6 +18,7 @@ import stat
from entropy.const import etpConst, const_debug_write, const_debug_enabled, \
const_mkstemp
from entropy.client.mirrors import StatusInterface
from entropy.exceptions import InterruptError
from entropy.fetchers import UrlFetcher
from entropy.i18n import _
from entropy.output import red, darkred, blue, purple, darkgreen, brown
@@ -470,7 +471,7 @@ class _PackageFetchAction(PackageAction):
delta_checksum = delta_fetcher.download()
data_transfer = delta_fetcher.get_transfer_rate()
del delta_fetcher
except KeyboardInterrupt:
except (KeyboardInterrupt, InterruptError):
return -100, data_transfer
except NameError:
@@ -569,7 +570,7 @@ class _PackageFetchAction(PackageAction):
fetch_checksum = fetch_intf.download()
data_transfer = fetch_intf.get_transfer_rate()
resumed = fetch_intf.is_resumed()
except KeyboardInterrupt:
except (KeyboardInterrupt, InterruptError):
return -100, data_transfer, resumed
except NameError:

View File

@@ -16,6 +16,7 @@ import threading
from entropy.const import etpConst, const_setup_perms, const_mkstemp
from entropy.client.mirrors import StatusInterface
from entropy.exceptions import InterruptError
from entropy.fetchers import UrlFetcher
from entropy.output import blue, darkblue, bold, red, darkred, brown, darkgreen
from entropy.i18n import _, ngettext
@@ -301,7 +302,7 @@ class _PackageMultiFetchAction(_PackageFetchAction):
fetch_abort_function()
data = fetch_intf.download()
except KeyboardInterrupt:
except (KeyboardInterrupt, InterruptError):
return [], 0.0, -100
data_transfer = fetch_intf.get_transfer_rate()
@@ -481,7 +482,7 @@ class _PackageMultiFetchAction(_PackageFetchAction):
fetch_abort_function()
data = fetch_intf.download()
except KeyboardInterrupt:
except (KeyboardInterrupt, InterruptError):
return -100, {}, 0
failed_map = {}