mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Handle exception on Python 3 correctly. Fixed #314.
This commit is contained in:
parent
f29445b045
commit
4cac29036f
|
@ -348,7 +348,7 @@ def _download_url(resp, link, temp_location):
|
||||||
download_hash = md5()
|
download_hash = md5()
|
||||||
try:
|
try:
|
||||||
total_length = int(resp.info()['content-length'])
|
total_length = int(resp.info()['content-length'])
|
||||||
except (ValueError, KeyError):
|
except (ValueError, KeyError, TypeError):
|
||||||
total_length = 0
|
total_length = 0
|
||||||
downloaded = 0
|
downloaded = 0
|
||||||
show_progress = total_length > 40*1000 or not total_length
|
show_progress = total_length > 40*1000 or not total_length
|
||||||
|
|
Loading…
Reference in a new issue