[tor-commits] [bridgedb/master] Move constant ALPHANUMERIC into function isValidRouterNickname().

isis at torproject.org isis at torproject.org
Sun Jan 12 06:06:34 UTC 2014


commit fa1a3f8052beca8312ff8dda30f7acf1581952e8
Author: Isis Lovecruft <isis at torproject.org>
Date:   Sun Dec 8 00:26:00 2013 +0000

    Move constant ALPHANUMERIC into function isValidRouterNickname().
    
    It isn't used anywhere else, and it would be silly to import it from
    here, so there is no reason to have it at the module level.
---
 lib/bridgedb/parse/networkstatus.py |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/bridgedb/parse/networkstatus.py b/lib/bridgedb/parse/networkstatus.py
index 1683d38..1cb54d3 100644
--- a/lib/bridgedb/parse/networkstatus.py
+++ b/lib/bridgedb/parse/networkstatus.py
@@ -45,14 +45,13 @@ class InvalidRouterNickname(ValueError):
     """Router nickname doesn't follow tor-spec."""
 
 
-ALPHANUMERIC = string.letters + string.digits
-
-
 def isValidRouterNickname(nickname):
     """Determine if a router's given nickname meets the specification.
 
     :param string nickname: An OR's nickname.
     """
+    ALPHANUMERIC = string.letters + string.digits
+
     try:
         if not (1 <= len(nickname) <= 19):
             raise InvalidRouterNickname(





More information about the tor-commits mailing list