[tor-commits] [bridgedb/master] Fix bug where open() was called even when COUNTY_BLOCK_FILE=None.
isis at torproject.org
isis at torproject.org
Sun Jan 12 06:06:36 UTC 2014
commit b659bbc75ad91979e0e182f28138dc8bb0b47a94
Author: Isis Lovecruft <isis at torproject.org>
Date: Sun Jan 12 03:57:55 2014 +0000
Fix bug where open() was called even when COUNTY_BLOCK_FILE=None.
---
lib/bridgedb/Bucket.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/bridgedb/Bucket.py b/lib/bridgedb/Bucket.py
index a32adcd..6b8bf54 100644
--- a/lib/bridgedb/Bucket.py
+++ b/lib/bridgedb/Bucket.py
@@ -222,7 +222,7 @@ class BucketManager:
# for a bridge, get the list of countries it might not work in
blocklist = dict()
- if hasattr(self.cfg, "COUNTRY_BLOCK_FILE"):
+ if getattr(self.cfg, "COUNTRY_BLOCK_FILE", None) is not None:
f = open(self.cfg.COUNTRY_BLOCK_FILE, 'r')
for ID,address,portlist,countries in bridgedb.Bridges.parseCountryBlockFile(f):
blocklist[toHex(ID)] = countries
More information about the tor-commits
mailing list