mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 18:54:51 -04:00
Move more xrange to six
plus a bonus next() Signed-off-by: Adrian Tschira <nota@notafile.com>
This commit is contained in:
parent
9558236728
commit
d82b6ea9e6
9 changed files with 28 additions and 11 deletions
|
@ -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([
|
||||
preserve_fn(_concurrently_execute_inner)()
|
||||
for _ in xrange(limit)
|
||||
for _ in range(limit)
|
||||
], consumeErrors=True)).addErrback(unwrapFirstError)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue