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:
rjhelms 2020-11-19 14:52:52 -05:00
parent 67610c99cd
commit 2160daea00
1 changed files with 1 additions and 1 deletions

View File

@ -21,7 +21,7 @@ class ReplayGainAnalyzer(Analyzer):
command = [ReplayGainAnalyzer.REPLAYGAIN_EXECUTABLE, '-d', filename]
try:
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'
replaygain = re.search(gain_match, results).group(1)
metadata['replay_gain'] = float(replaygain)