Commit 939f6f03 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

BF: urlopen error was being masked

parent 0a15ed13
......@@ -694,6 +694,7 @@ def download_file(url, destination, progress=None, blocksize=1048576):
log.debug('Downloading %s ...', url)
req = None
try:
# py2: urlopen result cannot be
# used as a context manager
......@@ -719,7 +720,8 @@ def download_file(url, destination, progress=None, blocksize=1048576):
raise DownloadFailed('A network error has occurred while '
'trying to download {}'.format(url))
finally:
req.close()
if req:
req.close()
class Process(object):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment