modernize

This commit is contained in:
Pavol Rusnak 2024-10-07 11:15:03 +02:00
parent 5e15c43ab7
commit 2a13ed0921
No known key found for this signature in database
GPG key ID: 91F3B339B9A02A3D
103 changed files with 822 additions and 906 deletions

View file

@ -32,8 +32,7 @@ class OpusDecoder:
if self._decoder is None:
if n < 0 or n > 2:
raise PyOggError(
"Invalid number of channels in call to "+
"set_channels()"
f"Invalid number of channels in call to set_channels()"
)
self._channels = n
else:
@ -65,7 +64,7 @@ class OpusDecoder:
else:
raise PyOggError(
"Specified sampling frequency "+
"({:d}) ".format(samples_per_second)+
f"({samples_per_second:d}) "+
"was not one of the accepted values"
)
else:
@ -152,7 +151,7 @@ class OpusDecoder:
# avoid floating-point comparisons.
if int(frame_duration*10) not in [25, 50, 100, 200, 400, 600]:
raise PyOggError(
"Frame duration ({:f}) is not one of the accepted values".format(frame_duration)
f"Frame duration ({frame_duration:f}) is not one of the accepted values"
)
# Calculate frame size