提交 18adb949 编写于 作者: L liuqi

Fix the python download exception bug.

上级 e988e951
......@@ -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.
先完成此消息的编辑!
想要评论请 注册