diff --git a/eventlet/jsonhttp.py b/eventlet/jsonhttp.py index 7c84af5..2fc0e54 100644 --- a/eventlet/jsonhttp.py +++ b/eventlet/jsonhttp.py @@ -28,9 +28,9 @@ import simplejson def safe_load(what): - if not what: - return None - return simplejson.loads(what) + if not what: + return None + return simplejson.loads(what) suite = httpc.HttpSuite(simplejson.dumps, safe_load, 'application/json') diff --git a/eventlet/pools.py b/eventlet/pools.py index 7880a79..4f8ccb1 100644 --- a/eventlet/pools.py +++ b/eventlet/pools.py @@ -161,10 +161,10 @@ class ConnectionPool(Pool): together to do HTTP keepalive sockets without errors. """ def __init__(self, proto, netloc, use_proxy, min_size=0, max_size=4): - self.proto = proto - self.netloc = netloc - self.use_proxy = use_proxy - Pool.__init__(self, min_size, max_size) + self.proto = proto + self.netloc = netloc + self.use_proxy = use_proxy + Pool.__init__(self, min_size, max_size) def create(self): return httpc.make_connection(self.proto, self.netloc, self.use_proxy) diff --git a/eventlet/saranwrap.py b/eventlet/saranwrap.py index 3b081a5..14e0a37 100644 --- a/eventlet/saranwrap.py +++ b/eventlet/saranwrap.py @@ -309,11 +309,11 @@ not supported, so you have to know what has been exported. _dead_list = my_cp._dead_list for dead_object in _dead_list.copy(): - request = Request('del', {'id':dead_object}) + request = Request('del', {'id':dead_object}) - my_cp.make_request(request) - _dead_list.remove(dead_object) - + my_cp.make_request(request) + _dead_list.remove(dead_object) + # Pass all public attributes across to find out if it is # callable or a simple attribute. request = Request('getattr', {'id':my_id, 'attribute':attribute}) diff --git a/eventlet/tpool_test.py b/eventlet/tpool_test.py index 61501bd..0af2e23 100644 --- a/eventlet/tpool_test.py +++ b/eventlet/tpool_test.py @@ -39,14 +39,14 @@ class yadda(object): def sender_loop(pfx): n = 0 obj = tpool.Proxy(yadda()) - while True: + while n < 10: api.sleep(0) now = time.time() print "%s: send (%s,%s)" % (pfx,now,n) rv = obj.foo(now,n=n) print "%s: recv %s" % (pfx, rv) assert(n == rv) - api.sleep(0.5) + api.sleep(0) n += 1 def test1(): diff --git a/eventlet/wrappedfd.py b/eventlet/wrappedfd.py index 2adf37a..a5ab0aa 100644 --- a/eventlet/wrappedfd.py +++ b/eventlet/wrappedfd.py @@ -244,7 +244,7 @@ class wrapped_fd(object): def read(self, size=None): if size is not None and not isinstance(size, (int, long)): - raise TypeError('Expecting an int or long for size, got %s: %s' % (type(size), repr(size))) + raise TypeError('Expecting an int or long for size, got %s: %s' % (type(size), repr(size))) buf, self.recvbuffer = self.recvbuffer, '' lst = [buf] if size is None: