From 82d2f6bd1a6f66e9c101ef0a6b98230753bff78c Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Sat, 18 Feb 2012 23:36:43 +0100 Subject: url_titles: Don't throw errors when missing Content-Type. --- modules/url_titles.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'modules') diff --git a/modules/url_titles.py b/modules/url_titles.py index 24783ac..932e557 100644 --- a/modules/url_titles.py +++ b/modules/url_titles.py @@ -71,6 +71,9 @@ class Module: u = urllib2.urlopen(url) except: return + if not 'content-type' in u.headers: + u.close() + continue if u.headers['content-type'].startswith('text/html'): #s = u.read() if 'content-encoding' in u.headers and u.headers['content-encoding'] == 'gzip': -- cgit v1.2.3