commit c05e5ac9b20107152d9853e6f9f6947172e8745e Author: Arturo Filastò art@fuffa.org Date: Fri Dec 27 23:08:01 2013 +0100
Set country code to be ZZ if no country code is detected. --- ooni/geoip.py | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/ooni/geoip.py b/ooni/geoip.py index 33766f3..6c539e9 100644 --- a/ooni/geoip.py +++ b/ooni/geoip.py @@ -40,6 +40,8 @@ def IPToLocation(ipaddr):
country_dat = GeoIP(country_file) location['countrycode'] = country_dat.country_code_by_addr(ipaddr) + if not location['countrycode']: + location['countrycode'] = 'ZZ'
asn_dat = GeoIP(asn_file) try:
tor-commits@lists.torproject.org