[svn r75] Ran reindent.py over eventlet, it caught some places where the indentation was incorrect. Also change tpool_test to complete in finite time.
This commit is contained in:
@@ -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')
|
||||
|
@@ -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)
|
||||
|
@@ -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})
|
||||
|
@@ -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():
|
||||
|
@@ -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:
|
||||
|
Reference in New Issue
Block a user