diff --git a/modules/head.py b/modules/head.py index 3835522..bc0df6f 100644 --- a/modules/head.py +++ b/modules/head.py @@ -152,7 +152,7 @@ def gettitle(phenny, uri): #bytes = u.read(262144) #u.close() - except web.ConnectionError: + except: return m = r_title.search(bytes) diff --git a/modules/test/test_head.py b/modules/test/test_head.py index d92ceee..95ed2c0 100644 --- a/modules/test/test_head.py +++ b/modules/test/test_head.py @@ -49,3 +49,12 @@ class TestHead(unittest.TestCase): snarfuri(self.phenny, input) self.phenny.msg.assert_called_once_with('#phenny', "[ Google ]") + + def test_snarfuri_405(self): + self.phenny.config.prefix = '.' + self.phenny.config.linx_api_key = "" + input = Mock(group=lambda x=0: 'http://ozuma.sakura.ne.jp/httpstatus/405', + sender='#phenny') + snarfuri(self.phenny, input) + + self.assertEqual(self.phenny.msg.called, False)