Fix replaygain_analyzer in Python 3.5
'text' argument was added in Python 3.7 as an alias of 'universal_newlines'. Using 'universal_newlines' works on Python 3.5/3.6 and should be forward-compatible.
This commit is contained in:
parent
67610c99cd
commit
2160daea00
|
@ -21,7 +21,7 @@ class ReplayGainAnalyzer(Analyzer):
|
||||||
command = [ReplayGainAnalyzer.REPLAYGAIN_EXECUTABLE, '-d', filename]
|
command = [ReplayGainAnalyzer.REPLAYGAIN_EXECUTABLE, '-d', filename]
|
||||||
try:
|
try:
|
||||||
results = subprocess.check_output(command, stderr=subprocess.STDOUT,
|
results = subprocess.check_output(command, stderr=subprocess.STDOUT,
|
||||||
close_fds=True, text=True)
|
close_fds=True, universal_newlines=True)
|
||||||
gain_match = r'Calculating Replay Gain information \.\.\.(?:\n|.)*?:([\d.-]*) dB'
|
gain_match = r'Calculating Replay Gain information \.\.\.(?:\n|.)*?:([\d.-]*) dB'
|
||||||
replaygain = re.search(gain_match, results).group(1)
|
replaygain = re.search(gain_match, results).group(1)
|
||||||
metadata['replay_gain'] = float(replaygain)
|
metadata['replay_gain'] = float(replaygain)
|
||||||
|
|
Loading…
Reference in New Issue