Skip to content

Commit

Permalink
Replace Queue with six.moves.queue
Browse files Browse the repository at this point in the history
and a six.range change which I missed the last time

Signed-off-by: Adrian Tschira <[email protected]>
  • Loading branch information
NotAFile committed Apr 15, 2018
1 parent 154b44c commit 878995e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions synapse/storage/event_federation.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
from unpaddedbase64 import encode_base64

import logging
from Queue import PriorityQueue, Empty
from six.moves.queue import PriorityQueue, Empty

from six.moves import range


logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -78,7 +80,7 @@ def _get_auth_chain_ids_txn(self, txn, event_ids, include_given):
front_list = list(front)
chunks = [
front_list[x:x + 100]
for x in xrange(0, len(front), 100)
for x in range(0, len(front), 100)
]
for chunk in chunks:
txn.execute(
Expand Down
4 changes: 2 additions & 2 deletions synapse/util/file_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

from synapse.util.logcontext import make_deferred_yieldable, preserve_fn

import Queue
from six.moves import queue


class BackgroundFileConsumer(object):
Expand Down Expand Up @@ -49,7 +49,7 @@ def __init__(self, file_obj):

# Queue of slices of bytes to be written. When producer calls
# unregister a final None is sent.
self._bytes_queue = Queue.Queue()
self._bytes_queue = queue.Queue()

# Deferred that is resolved when finished writing
self._finished_deferred = None
Expand Down

0 comments on commit 878995e

Please sign in to comment.