amprolla

devuan's apt repo merger
git clone git://parazyd.org/amprolla.git
Log | Files | Refs | README | LICENSE

commit 5c55549a68fec31bd673487b65cd0cb4ca0ccfd6
parent ae0f2f3219c8d65dbf826b49845ed37534fd1443
Author: parazyd <parazyd@dyne.org>
Date:   Wed, 28 Jun 2017 10:23:38 +0200

try to handle connection interrupts in net.download

Diffstat:
Mlib/net.py | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/net.py b/lib/net.py @@ -19,7 +19,11 @@ def download(uris): path = uris[1] info("dl: %s" % url) - r = requests.get(url, stream=True) + try: + r = requests.get(url, stream=True) + except requests.exceptions.ConnectionError: + warn("Caught exception: Connection reset. Retrying.") + download(uris) if r.status_code == 404: warn("failed: 404 not found!")