[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [ooni-probe/master] Set country code to be ZZ if no country code is detected.
commit c05e5ac9b20107152d9853e6f9f6947172e8745e
Author: Arturo Filastò <art@xxxxxxxxx>
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 mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits