[or-cvs] [bridgedb/master] Fix pychecker warnings.

Nick Mathewson nickm at seul.org
Mon Oct 12 22:40:38 UTC 2009


Author: Nick Mathewson <nickm at torproject.org>
Date: Mon, 12 Oct 2009 17:48:48 -0400
Subject: Fix pychecker warnings.
Commit: 9b3eec07e62c41ce29bcba1d68437951cee2ca42

---
 lib/bridgedb/Bridges.py |    2 +-
 lib/bridgedb/Dist.py    |    8 ++++----
 lib/bridgedb/Storage.py |    1 -
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/lib/bridgedb/Bridges.py b/lib/bridgedb/Bridges.py
index 9d588da..7ba5d6d 100644
--- a/lib/bridgedb/Bridges.py
+++ b/lib/bridgedb/Bridges.py
@@ -437,7 +437,7 @@ class BridgeSplitter(BridgeHolder):
 
         for s in self.statsHolders:
             s.insert(bridge)
-        if bridge.running == False or bridge.running == None:
+        if not bridge.running:
             return
 
         bridgeID = bridge.getID()
diff --git a/lib/bridgedb/Dist.py b/lib/bridgedb/Dist.py
index 6410a28..c981f79 100644
--- a/lib/bridgedb/Dist.py
+++ b/lib/bridgedb/Dist.py
@@ -250,11 +250,11 @@ class EmailBasedDistributor(bridgedb.Bridges.BridgeHolder):
 
         db = bridgedb.Storage.getDB()
 
-        lastSaw = db.getEmailTime(emailadress)
+        lastSaw = db.getEmailTime(emailaddress)
         if lastSaw + MAX_EMAIL_RATE >= now:
-            log.warning("Got a request for bridges from %r; we already "
-                        "answered one within the last %d seconds. Ignoring.",
-                        emailaddress, MAX_EMAIL_RATE)
+            logging.warn("Got a request for bridges from %r; we already "
+                         "answered one within the last %d seconds. Ignoring.",
+                         emailaddress, MAX_EMAIL_RATE)
             raise TooSoonEmail("Too many emails; wait till later", emailaddress)
 
         pos = self.emailHmac("<%s>%s" % (epoch, emailaddress))
diff --git a/lib/bridgedb/Storage.py b/lib/bridgedb/Storage.py
index 95c83cd..cc40fc4 100644
--- a/lib/bridgedb/Storage.py
+++ b/lib/bridgedb/Storage.py
@@ -5,7 +5,6 @@
 import calendar
 import os
 import logging
-import bridgedb.Bridges
 import binascii
 import sqlite3
 import time
-- 
1.5.6.5




More information about the tor-commits mailing list