[preview] catch type error when clen is None

This commit is contained in:
Romain DEP.
2017-11-04 22:14:07 +04:00
parent df04516e85
commit 8e2ad109f6

View File

@@ -67,7 +67,7 @@ def _get_http_head_direct(url):
clen = f.headers['Content-Length'] clen = f.headers['Content-Length']
try: try:
clen = int(clen) clen = int(clen)
except ValueError: except (TypeError, ValueError):
pass pass
return (ctype, clen) return (ctype, clen)