Handle exception on Python 3 correctly. Fixed #314.

This commit is contained in:
Jannis Leidel 2011-07-16 16:17:24 +02:00
parent f29445b045
commit 4cac29036f
1 changed files with 1 additions and 1 deletions

View File

@ -348,7 +348,7 @@ def _download_url(resp, link, temp_location):
download_hash = md5()
try:
total_length = int(resp.info()['content-length'])
except (ValueError, KeyError):
except (ValueError, KeyError, TypeError):
total_length = 0
downloaded = 0
show_progress = total_length > 40*1000 or not total_length