Make character-presence checks more pythonic
This commit is contained in:
parent
3b203cbc12
commit
baeabbd605
1 changed files with 2 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue