Commit b8bf7498 authored by Denis Bilenko's avatar Denis Bilenko

examples: xrange() -> range()

for python3 compatibility (#38)
parent 54cb4e74
......@@ -34,7 +34,7 @@ def job(url):
finished += 1
with gevent.Timeout(2, False):
for x in xrange(10, 10 + N):
for x in range(10, 10 + N):
pool.spawn(job, '%s.com' % x)
pool.join()
......
......@@ -143,7 +143,7 @@ if __name__ == '__main__':
import time
pool = PostgresConnectionPool("dbname=postgres", maxsize=3)
start = time.time()
for _ in xrange(4):
for _ in range(4):
gevent.spawn(pool.execute, 'select pg_sleep(1);')
gevent.wait()
delay = time.time() - start
......
......@@ -5,7 +5,7 @@ from gevent.threadpool import ThreadPool
pool = ThreadPool(3)
start = time.time()
for _ in xrange(4):
for _ in range(4):
pool.spawn(time.sleep, 1)
gevent.wait()
delay = time.time() - start
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment