Skip to content

Commit

Permalink
Remove py3.7-specific syntax to support 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Kovalenko committed Nov 11, 2020
1 parent a2b1c22 commit dc41b6b
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions spotcli/elastigroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,14 @@ def find(cls, spot, query):
return [cls(spot, groups[query])]

# Substring match
if (
matches := [cls(spot, groups[group]) for group in groups if query in group]
) :
matches = [cls(spot, groups[group]) for group in groups if query in group]
if matches:
return matches

# Regular expression match
regex = re.compile(query, re.IGNORECASE | re.ASCII)
if (
matches := [
cls(spot, groups[group]) for group in groups if regex.search(group)
]
) :
matches = [cls(spot, groups[group]) for group in groups if regex.search(group)]
if matches:
return matches

return []
Expand Down

0 comments on commit dc41b6b

Please sign in to comment.