Revert some instances of s/iteritems/items/ in be118c3338.

This commit is contained in:
Valentin Lorentz 2016-11-11 13:04:00 +01:00
parent 9c57199838
commit 95a1f21600
2 changed files with 4 additions and 4 deletions

View File

@ -219,9 +219,9 @@ class IterableMap(object):
"""Define .items() in a class and subclass this to get the other iters.
"""
def items(self):
if minisix.PY3 and hasattr(self, 'items'):
if minisix.PY3 and hasattr(self, 'iteritems'):
# For old plugins
return getattr(self, 'items')() # avoid 2to3
return self.iteritems() # avoid 2to3
else:
raise NotImplementedError()
__iter__ = items

View File

@ -381,8 +381,8 @@ class MaxLengthQueue(queue):
class TwoWayDictionary(dict):
__slots__ = ()
def __init__(self, seq=(), **kwargs):
if hasattr(seq, 'items'):
seq = seq.items()
if hasattr(seq, 'iteritems'):
seq = seq.iteritems()
elif hasattr(seq, 'items'):
seq = seq.items()
for (key, value) in seq: