Skip to content

Commit

Permalink
Backward compatible use of RegEx match objects
Browse files Browse the repository at this point in the history
  • Loading branch information
tilmankamp committed May 8, 2020
1 parent fe2bb68 commit cf84a32
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions training/deepspeech_training/util/signal_augmentations.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,11 @@ def parse_augmentation(augmentation_spec):
match = SPEC_PARSER.match(augmentation_spec)
if not match:
raise ValueError('Augmentation specification has wrong format')
cls_name = match[1][0].upper() + match[1][1:]
cls_name = match.group(1)[0].upper() + match.group(1)[1:]
if cls_name not in globals():
raise ValueError('Unknown augmentation: {}'.format(cls_name))
augmentation_cls = globals()[cls_name]
parameters = [] if match[3] is None else match[3].split(',')
parameters = [] if match.group(3) is None else match.group(3).split(',')
args = []
kwargs = {}
for parameter in parameters:
Expand Down

0 comments on commit cf84a32

Please sign in to comment.