Skip to content

Commit

Permalink
Make character-presence checks more pythonic
Browse files Browse the repository at this point in the history
  • Loading branch information
AI0867 committed Oct 2, 2017
1 parent 3b203cb commit baeabbd
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions data/tools/wesnoth/wmltools3.py
Expand Up @@ -27,11 +27,9 @@ def __repr__(self):

def split_filenames(match):
filename_group = match.group(1)
bracket = filename_group.find('[')
comma = filename_group.find(',')
if not comma:
if ',' not in filename_group:
yield filename_group
elif not bracket:
elif '[' not in filename_group:
yield from filename_group.split(',')
else:
bracket_depth = 0
Expand Down

0 comments on commit baeabbd

Please sign in to comment.