Skip to content

Commit

Permalink
Merge pull request #504 from glebm/patch-1
Browse files Browse the repository at this point in the history
utils.py: Fix "invalid escape sequence \(" warning
  • Loading branch information
GreyAlien502 authored Apr 21, 2021
2 parents 72b474e + ebdedc8 commit e9ce529
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pydub/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@ def set_property(stream, prop, value):
stream[prop] = value

for token in extra_info[stream['index']]:
m = re.match('([su]([0-9]{1,2})p?) \(([0-9]{1,2}) bit\)$', token)
m2 = re.match('([su]([0-9]{1,2})p?)( \(default\))?$', token)
m = re.match(r'([su]([0-9]{1,2})p?) \(([0-9]{1,2}) bit\)$', token)
m2 = re.match(r'([su]([0-9]{1,2})p?)( \(default\))?$', token)
if m:
set_property(stream, 'sample_fmt', m.group(1))
set_property(stream, 'bits_per_sample', int(m.group(2)))
Expand All @@ -307,11 +307,11 @@ def set_property(stream, prop, value):
set_property(stream, 'sample_fmt', m2.group(1))
set_property(stream, 'bits_per_sample', int(m2.group(2)))
set_property(stream, 'bits_per_raw_sample', int(m2.group(2)))
elif re.match('(flt)p?( \(default\))?$', token):
elif re.match(r'(flt)p?( \(default\))?$', token):
set_property(stream, 'sample_fmt', token)
set_property(stream, 'bits_per_sample', 32)
set_property(stream, 'bits_per_raw_sample', 32)
elif re.match('(dbl)p?( \(default\))?$', token):
elif re.match(r'(dbl)p?( \(default\))?$', token):
set_property(stream, 'sample_fmt', token)
set_property(stream, 'bits_per_sample', 64)
set_property(stream, 'bits_per_raw_sample', 64)
Expand Down

0 comments on commit e9ce529

Please sign in to comment.