Skip to content

Commit

Permalink
Fix issue when calling filter_by_name with string.
Browse files Browse the repository at this point in the history
  • Loading branch information
prabhuramachandran committed Sep 28, 2018
1 parent 465c422 commit 7fe6edc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions automan/automation.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,8 @@ def filter_by_name(cases, names):
"""Filter a sequence of Simulations by their names. That is, if the case
has a name contained in the given `names`, it will be selected.
"""
if isinstance(names, str):
names = [names]
return sorted(
[x for x in cases if x.name in names],
key=lambda x: names.index(x.name)
Expand Down

0 comments on commit 7fe6edc

Please sign in to comment.