Use list comprehensions instead of filter() for easier moto/swf python 3.x compatibility
This commit is contained in:
parent
3a5f679783
commit
b386495520
2 changed files with 7 additions and 11 deletions
|
|
@ -193,7 +193,7 @@ class SWFBackend(BaseBackend):
|
|||
candidates = []
|
||||
for _task_list, tasks in domain.decision_task_lists.items():
|
||||
if _task_list == task_list:
|
||||
candidates += filter(lambda t: t.state == "SCHEDULED", tasks)
|
||||
candidates += [t for t in tasks if t.state == "SCHEDULED"]
|
||||
if any(candidates):
|
||||
# TODO: handle task priorities (but not supported by boto for now)
|
||||
task = min(candidates, key=lambda d: d.scheduled_at)
|
||||
|
|
@ -293,7 +293,7 @@ class SWFBackend(BaseBackend):
|
|||
candidates = []
|
||||
for _task_list, tasks in domain.activity_task_lists.items():
|
||||
if _task_list == task_list:
|
||||
candidates += filter(lambda t: t.state == "SCHEDULED", tasks)
|
||||
candidates += [t for t in tasks if t.state == "SCHEDULED"]
|
||||
if any(candidates):
|
||||
# TODO: handle task priorities (but not supported by boto for now)
|
||||
task = min(candidates, key=lambda d: d.scheduled_at)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue