summary refs log tree commit diff
path: root/synapse/util/async.py
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2018-04-30 01:20:06 +0100
committerGitHub <noreply@github.com>2018-04-30 01:20:06 +0100
commit683149c1f98fec9bc39835083e608057af535b10 (patch)
tree0816263ed10369755f1aea7090cd39ee4dea56d7 /synapse/util/async.py
parentMerge branch 'rav/test_36' into develop (diff)
parentMerge branch 'develop' into py3-xrange-1 (diff)
downloadsynapse-683149c1f98fec9bc39835083e608057af535b10.tar.xz
Merge pull request #3151 from NotAFile/py3-xrange-1
Move more xrange to six
Diffstat (limited to 'synapse/util/async.py')
-rw-r--r--synapse/util/async.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/util/async.py b/synapse/util/async.py
index 4a762d1e72..9dd4e6b5bc 100644
--- a/synapse/util/async.py
+++ b/synapse/util/async.py
@@ -27,6 +27,8 @@ from contextlib import contextmanager
 
 import logging
 
+from six.moves import range
+
 logger = logging.getLogger(__name__)
 
 
@@ -158,13 +160,13 @@ def concurrently_execute(func, args, limit):
     def _concurrently_execute_inner():
         try:
             while True:
-                yield func(it.next())
+                yield func(next(it))
         except StopIteration:
             pass
 
     return logcontext.make_deferred_yieldable(defer.gatherResults([
         run_in_background(_concurrently_execute_inner)
-        for _ in xrange(limit)
+        for _ in range(limit)
     ], consumeErrors=True)).addErrback(unwrapFirstError)