[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [oonib/master] remove mutable class-level variable that's always overridden by a fresh instance variable with the same name (at least within this code, and I'm going to assume that's how it's meant to be used)



commit 5a21e98880a7e903f335ada22856248f346dad5a
Author: Darius Bacon <darius@xxxxxx>
Date:   Wed Apr 16 12:28:59 2014 -0700

    remove mutable class-level variable that's always overridden by a fresh instance variable with the same name (at least within this code, and I'm going to assume that's how it's meant to be used)
---
 oonib/testhelpers/http_helpers.py |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/oonib/testhelpers/http_helpers.py b/oonib/testhelpers/http_helpers.py
index 3a76b9a..8f09326 100644
--- a/oonib/testhelpers/http_helpers.py
+++ b/oonib/testhelpers/http_helpers.py
@@ -40,11 +40,11 @@ class SimpleHTTPChannel(basic.LineReceiver, policies.TimeoutMixin):
     length = 0
     maxHeaders = 500
     requestLine = ''
-    headers = []
 
     timeOut = 60 * 60 * 12
 
     def __init__(self):
+        self.headers = []
         self.requests = []
 
     def connectionMade(self):
@@ -98,9 +98,7 @@ class SimpleHTTPChannel(basic.LineReceiver, policies.TimeoutMixin):
 class HTTPReturnJSONHeadersHelper(protocol.ServerFactory):
     protocol = SimpleHTTPChannel
     def buildProtocol(self, addr):
-        p = self.protocol()
-        p.headers = []
-        return p
+        return self.protocol()
 
 class HTTPTrapAll(RequestHandler):
     def _execute(self, transforms, *args, **kwargs):



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits