fix when website is offline
This commit is contained in:
parent
2f07993c97
commit
0e430f9ccc
1 changed files with 4 additions and 1 deletions
|
|
@ -21,7 +21,7 @@ from __future__ import with_statement
|
||||||
|
|
||||||
from weboob.capabilities.geolocip import ICapGeolocIp, IpLocation
|
from weboob.capabilities.geolocip import ICapGeolocIp, IpLocation
|
||||||
from weboob.tools.backend import BaseBackend
|
from weboob.tools.backend import BaseBackend
|
||||||
from weboob.tools.browser import BaseBrowser
|
from weboob.tools.browser import BaseBrowser, BrowserUnavailable
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['GeolocIpBackend']
|
__all__ = ['GeolocIpBackend']
|
||||||
|
|
@ -44,6 +44,9 @@ class GeolocIpBackend(BaseBackend, ICapGeolocIp):
|
||||||
|
|
||||||
content = self.browser.readurl('http://www.geolocip.com/?s[ip]=%s&commit=locate+IP!' % str(ipaddr))
|
content = self.browser.readurl('http://www.geolocip.com/?s[ip]=%s&commit=locate+IP!' % str(ipaddr))
|
||||||
|
|
||||||
|
if content is None:
|
||||||
|
raise BrowserUnavailable()
|
||||||
|
|
||||||
tab = {}
|
tab = {}
|
||||||
last_line = ''
|
last_line = ''
|
||||||
line = ''
|
line = ''
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue