[tor-commits] [flashproxy/master] - fix pylint error: undefined variable

infinity0 at torproject.org infinity0 at torproject.org
Wed Nov 13 16:20:29 UTC 2013


commit c2a5a1e54137e73e98e3852020d4bdb1af15b621
Author: Ximin Luo <infinity0 at gmx.com>
Date:   Wed Nov 13 14:12:38 2013 +0000

    - fix pylint error: undefined variable
---
 facilitator/facilitator-email-poller |    2 +-
 facilitator/facilitator-reg-daemon   |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/facilitator/facilitator-email-poller b/facilitator/facilitator-email-poller
index 75f4ff2..5348219 100755
--- a/facilitator/facilitator-email-poller
+++ b/facilitator/facilitator-email-poller
@@ -93,7 +93,7 @@ def create_socket(address, timeout = None, source_address = None):
     host, port = address
     addrs = socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM)
     if not addrs:
-        raise error("getaddrinfo returns an empty list")
+        raise socket.error("getaddrinfo returns an empty list")
     err = None
     for addr in addrs:
         try:
diff --git a/facilitator/facilitator-reg-daemon b/facilitator/facilitator-reg-daemon
index 04f2102..cab7403 100755
--- a/facilitator/facilitator-reg-daemon
+++ b/facilitator/facilitator-reg-daemon
@@ -93,7 +93,8 @@ class Handler(SocketServer.StreamRequestHandler):
             if not data:
                 break
             self.buffer += data
-            if len(self.buffer) > MAX_LENGTH:
+            buflen = len(self.buffer)
+            if buflen > MAX_LENGTH:
                 raise socket.error("refusing to buffer %d bytes (last read was %d bytes)" % (buflen, len(data)))
         return self.buffer
 





More information about the tor-commits mailing list