From f6165fedf7fac04aba01c9fb892ab5767cb1917f Mon Sep 17 00:00:00 2001 From: Zhao Xiaohong Date: Tue, 16 Jul 2013 19:59:36 +0800 Subject: [PATCH] Fixed examples. --- examples/test_gevent.py | 8 ++++---- examples/test_threaded.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/test_gevent.py b/examples/test_gevent.py index 3e286f8..3d58398 100644 --- a/examples/test_gevent.py +++ b/examples/test_gevent.py @@ -33,7 +33,7 @@ def echo(sock, address): def runpool(data): with pool.connection(**options) as conn: - print ("conn: pool size: %s" % pool.size()) + print ("conn: pool size: %s" % pool.size) sent = conn.send(data) echo_data = conn.recv(1024) @@ -45,13 +45,13 @@ def runpool(data): gevent.joinall(jobs) delay = time.time() - start - print ("final pool size: %s" % pool.size()) + print ("final pool size: %s" % pool.size) with pool.connection(**options) as conn: - print ("conn: pool size: %s" % pool.size()) + print ("conn: pool size: %s" % pool.size) sent = conn.send("hello") echo_data = conn.recv(1024) assert "hello" == echo_data - print ("final pool size: %s" % pool.size()) + print ("final pool size: %s" % pool.size) diff --git a/examples/test_threaded.py b/examples/test_threaded.py index a62fd32..a497912 100644 --- a/examples/test_threaded.py +++ b/examples/test_threaded.py @@ -72,7 +72,7 @@ def runpool(): break try: with pool.connection() as conn: - print("conn: pool size: %s" % pool.size()) + print("conn: pool size: %s" % pool.size) sent = conn.send(data) echo = conn.recv(1024) print("got %s" % data) @@ -91,7 +91,7 @@ def runpool(): q.join() - print ("final pool size: %s" % pool.size()) + print ("final pool size: %s" % pool.size) pool.release_all() server.shutdown()