mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 12:06:08 -04:00
Consistently use six's iteritems and wrap lazy keys/values in list() if they're not meant to be lazy (#3307)
This commit is contained in:
parent
872cf43516
commit
c936a52a9e
29 changed files with 116 additions and 101 deletions
|
@ -1,3 +1,5 @@
|
|||
from six import itervalues
|
||||
|
||||
SENTINEL = object()
|
||||
|
||||
|
||||
|
@ -49,7 +51,7 @@ class TreeCache(object):
|
|||
if popped is SENTINEL:
|
||||
return default
|
||||
|
||||
node_and_keys = zip(nodes, key)
|
||||
node_and_keys = list(zip(nodes, key))
|
||||
node_and_keys.reverse()
|
||||
node_and_keys.append((self.root, None))
|
||||
|
||||
|
@ -76,7 +78,7 @@ def iterate_tree_cache_entry(d):
|
|||
can contain dicts.
|
||||
"""
|
||||
if isinstance(d, dict):
|
||||
for value_d in d.itervalues():
|
||||
for value_d in itervalues(d):
|
||||
for value in iterate_tree_cache_entry(value_d):
|
||||
yield value
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue