From 8e2ad109f6e4f6e70353541f7b84a74a5e7f6ec7 Mon Sep 17 00:00:00 2001 From: "Romain DEP." Date: Sat, 4 Nov 2017 22:14:07 +0400 Subject: [PATCH] [preview] catch type error when clen is None --- url_image_preview/http_functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/url_image_preview/http_functions.py b/url_image_preview/http_functions.py index bd708b4..19fbf42 100644 --- a/url_image_preview/http_functions.py +++ b/url_image_preview/http_functions.py @@ -67,7 +67,7 @@ def _get_http_head_direct(url): clen = f.headers['Content-Length'] try: clen = int(clen) - except ValueError: + except (TypeError, ValueError): pass return (ctype, clen)