Make character-presence checks more pythonic

This commit is contained in:
Alexander van Gessel 2017-10-02 23:30:34 +02:00
parent 3b203cbc12
commit baeabbd605

View file

@ -27,11 +27,9 @@ class Substitution(object):
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