Replace filter() with a list-comprehension
A list is expected, whereas filter() returns a generator on Python 3. Partial-Implements: blueprint porting-python3 Change-Id: If3450c64c7ef086331b9a1d12d7d70b74260df60
This commit is contained in:
parent
750df2441e
commit
344100e1e4
@ -113,7 +113,8 @@ class TestDataContainer(object):
|
||||
def get_match(obj):
|
||||
return hasattr(obj, key) and getattr(obj, key) == value
|
||||
|
||||
return self.filter(filtered=filter(get_match, filtered), **kwargs)
|
||||
filtered = [obj for obj in filtered if get_match(obj)]
|
||||
return self.filter(filtered=filtered, **kwargs)
|
||||
|
||||
def get(self, **kwargs):
|
||||
"""Returns the single object in this container whose attributes match
|
||||
|
Loading…
x
Reference in New Issue
Block a user