Skip to content

Commit

Permalink
Convert a for loop into a list comprehension (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibFrgsGmz committed May 23, 2022
1 parent 064f0f1 commit 9c3947e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/fprime/fbuild/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,11 @@ def get_target(cls, mnemonic: str, flags: Set[str]) -> "Target":
Returns:
single matching target
"""
matching = []
for target in cls.get_all_targets():
if target.mnemonic == mnemonic and flags == target.flags:
matching.append(target)
matching = [
target
for target in cls.get_all_targets()
if target.mnemonic == mnemonic and flags == target.flags
]
if not matching:
raise NoSuchTargetException(
f"Could not find target '{cls.config_string(mnemonic, flags)}'"
Expand Down

0 comments on commit 9c3947e

Please sign in to comment.