提交 f654c291 编写于 作者: 叶剑武

Merge branch 'fix-download' into 'master'

Fix the python download exception bug.

See merge request !878
......@@ -673,7 +673,8 @@ def download_file(url, dst, num_retries=3):
try:
urllib.request.urlretrieve(url, dst)
MaceLogger.info('\nDownloaded successfully.')
except urllib.ContentTooShortError as e:
except (urllib.error.ContentTooShortError, urllib.error.HTTPError,
urllib.error.URLError) as e:
MaceLogger.warning('Download error:', e.reason)
if num_retries > 0:
return download_file(url, dst, num_retries - 1)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册