Advertisement
rfmonk

pygeopip__init__.py.patch

Nov 30th, 2013
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.70 KB | None | 0 0
  1. --- orig/__init__.py    2011-05-05 12:34:14.770879000 -0500
  2. +++ mine/__init__.py    2011-05-05 12:33:30.790879000 -0500
  3. @@ -277,9 +277,10 @@
  4.                  region = ''
  5.                  
  6.          elif self._databaseType in (CITY_EDITION_REV0, CITY_EDITION_REV1):
  7. -            rec = self._get_record(ipnum)
  8. -            country_code = rec['country_code']
  9. -            region = rec['region_name']
  10. +            rec = self._get_record(ipnum)
  11. +            country_code, region = "", ""
  12. +            if 'country_code' in rec: country_code = rec['country_code']
  13. +            if 'region_name' in rec: region = rec['region_name']
  14.              
  15.          return {'country_code' : country_code, 'region_name' : region }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement