Commits

Dominik Ruf committed 488edbb

setting timeout for getting url to 5 seconds

Comments (0)

Files changed (1)

collective/externalportrait/membership.py

             for url in settings.urls:
                 url = url % memberinfo
                 try:
-                    response = urlopen(url)
+                    response = urlopen(url, timeout=5)
                     if response.getcode() == 200:
                         portrait = DummyImage(url)
                         break
-                except:
+                except Exception, e:
                     pass
     return portrait