Commit 7751df35 by Jennifer Ennis

Merge pull request #6 from vatsan/master

Fixed bug in __init__.py line 294 (NoneType not iterable).
parents 397e6303 cdd26722
...@@ -295,8 +295,8 @@ class GeoIP(GeoIPBase): ...@@ -295,8 +295,8 @@ class GeoIP(GeoIPBase):
elif self._databaseType in (const.CITY_EDITION_REV0, const.CITY_EDITION_REV1): elif self._databaseType in (const.CITY_EDITION_REV0, const.CITY_EDITION_REV1):
rec = self._get_record(ipnum) rec = self._get_record(ipnum)
country_code = rec['country_code'] if 'country_code' in rec else '' country_code = rec['country_code'] if rec and 'country_code' in rec else ''
region = rec['region_name'] if 'region_name' in rec else '' region = rec['region_name'] if rec and 'region_name' in rec else ''
return {'country_code' : country_code, 'region_name' : region } return {'country_code' : country_code, 'region_name' : region }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment