[tor-commits] [stem/master] Default ignored when geoip was unavailable
atagar at torproject.org
atagar at torproject.org
Thu Dec 13 16:42:22 UTC 2012
commit 92a7c6f8224ce9e69caab7c52b027b77e77dc1e5
Author: Damian Johnson <atagar at torproject.org>
Date: Tue Dec 11 19:38:10 2012 -0800
Default ignored when geoip was unavailable
We ignored the default argument and always raised a ProtocolError if the geoip
database was unavalable - oops.
---
stem/control.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/stem/control.py b/stem/control.py
index d538a65..5c3863a 100644
--- a/stem/control.py
+++ b/stem/control.py
@@ -778,7 +778,9 @@ class Controller(BaseController):
params.remove(param)
elif param.startswith('ip-to-country/') and self.is_geoip_unavailable():
# the geoip database already looks to be unavailable - abort the request
- raise stem.ProtocolError("Tor geoip database is unavailable")
+ if default == UNDEFINED:
+ raise stem.ProtocolError("Tor geoip database is unavailable")
+ else: return default
# if everything was cached then short circuit making the query
if not params:
More information about the tor-commits
mailing list