[Pkg-privacy-commits] [txtorcon] 23/96: Don't fail if there is no GeoIP info at all

Jérémy Bobbio lunar at moszumanska.debian.org
Sun Sep 6 18:33:34 UTC 2015


This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch master
in repository txtorcon.

commit cad22ee9450aa0d72db19c31a9ffe502916ac09f
Author: meejah <meejah at meejah.ca>
Date:   Sat Jan 17 00:40:19 2015 -0700

    Don't fail if there is no GeoIP info at all
---
 txtorcon/router.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/txtorcon/router.py b/txtorcon/router.py
index 543ad96..aac4d71 100644
--- a/txtorcon/router.py
+++ b/txtorcon/router.py
@@ -95,8 +95,11 @@ class Router(object):
         else:
             self._location = NetLocation(None)
         if not self._location.countrycode and self.ip != 'unknown':
-            ## see if Tor is magic and knows more...
-            self.controller.get_info_raw('ip-to-country/' + self.ip).addCallback(self._set_country)
+            # see if Tor is magic and knows more...
+            d = self.controller.get_info_raw('ip-to-country/' + self.ip)
+            d.addCallback(self._set_country)
+            # ignore errors (e.g. "GeoIP Information not loaded")
+            d.addErrback(lambda _: None)
         return self._location
 
     @property

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/txtorcon.git



More information about the Pkg-privacy-commits mailing list