mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-10-07 13:08:24 -04:00
Replace iteritems/itervalues/iterkeys with native versions. (#7692)
This commit is contained in:
parent
2d11ea385c
commit
bd6dc17221
47 changed files with 184 additions and 263 deletions
|
@ -93,8 +93,8 @@ class FederationBase(object):
|
|||
# *actual* redacted copy to be on the safe side.)
|
||||
redacted_event = prune_event(pdu)
|
||||
if set(redacted_event.keys()) == set(pdu.keys()) and set(
|
||||
six.iterkeys(redacted_event.content)
|
||||
) == set(six.iterkeys(pdu.content)):
|
||||
redacted_event.content.keys()
|
||||
) == set(pdu.content.keys()):
|
||||
logger.info(
|
||||
"Event %s seems to have been redacted; using our redacted "
|
||||
"copy",
|
||||
|
|
|
@ -18,7 +18,6 @@ import logging
|
|||
from typing import Any, Callable, Dict, List, Match, Optional, Tuple, Union
|
||||
|
||||
import six
|
||||
from six import iteritems
|
||||
|
||||
from canonicaljson import json
|
||||
from prometheus_client import Counter
|
||||
|
@ -534,9 +533,9 @@ class FederationServer(FederationBase):
|
|||
",".join(
|
||||
(
|
||||
"%s for %s:%s" % (key_id, user_id, device_id)
|
||||
for user_id, user_keys in iteritems(json_result)
|
||||
for device_id, device_keys in iteritems(user_keys)
|
||||
for key_id, _ in iteritems(device_keys)
|
||||
for user_id, user_keys in json_result.items()
|
||||
for device_id, device_keys in user_keys.items()
|
||||
for key_id, _ in device_keys.items()
|
||||
)
|
||||
),
|
||||
)
|
||||
|
|
|
@ -33,8 +33,6 @@ import logging
|
|||
from collections import namedtuple
|
||||
from typing import Dict, List, Tuple, Type
|
||||
|
||||
from six import iteritems
|
||||
|
||||
from sortedcontainers import SortedDict
|
||||
|
||||
from twisted.internet import defer
|
||||
|
@ -327,7 +325,7 @@ class FederationRemoteSendQueue(object):
|
|||
# stream position.
|
||||
keyed_edus = {v: k for k, v in self.keyed_edu_changed.items()[i:j]}
|
||||
|
||||
for ((destination, edu_key), pos) in iteritems(keyed_edus):
|
||||
for ((destination, edu_key), pos) in keyed_edus.items():
|
||||
rows.append(
|
||||
(
|
||||
pos,
|
||||
|
@ -530,10 +528,10 @@ def process_rows_for_federation(transaction_queue, rows):
|
|||
states=[state], destinations=destinations
|
||||
)
|
||||
|
||||
for destination, edu_map in iteritems(buff.keyed_edus):
|
||||
for destination, edu_map in buff.keyed_edus.items():
|
||||
for key, edu in edu_map.items():
|
||||
transaction_queue.send_edu(edu, key)
|
||||
|
||||
for destination, edu_list in iteritems(buff.edus):
|
||||
for destination, edu_list in buff.edus.items():
|
||||
for edu in edu_list:
|
||||
transaction_queue.send_edu(edu, None)
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
import logging
|
||||
from typing import Dict, Hashable, Iterable, List, Optional, Set, Tuple
|
||||
|
||||
from six import itervalues
|
||||
|
||||
from prometheus_client import Counter
|
||||
|
||||
from twisted.internet import defer
|
||||
|
@ -218,7 +216,7 @@ class FederationSender(object):
|
|||
defer.gatherResults(
|
||||
[
|
||||
run_in_background(handle_room_events, evs)
|
||||
for evs in itervalues(events_by_room)
|
||||
for evs in events_by_room.values()
|
||||
],
|
||||
consumeErrors=True,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue