diff options
Diffstat (limited to 'discord/opus.py')
| -rw-r--r-- | discord/opus.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/discord/opus.py b/discord/opus.py index 94adf338..afc55175 100644 --- a/discord/opus.py +++ b/discord/opus.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - """ The MIT License (MIT) @@ -185,7 +183,7 @@ def _load_default(): _basedir = os.path.dirname(os.path.abspath(__file__)) _bitness = struct.calcsize('P') * 8 _target = 'x64' if _bitness > 32 else 'x86' - _filename = os.path.join(_basedir, 'bin', 'libopus-0.{}.dll'.format(_target)) + _filename = os.path.join(_basedir, 'bin', f'libopus-0.{_target}.dll') _lib = libopus_loader(_filename) else: _lib = libopus_loader(ctypes.util.find_library('opus')) @@ -310,14 +308,14 @@ class Encoder(_OpusStruct): def set_bandwidth(self, req): if req not in band_ctl: - raise KeyError('%r is not a valid bandwidth setting. Try one of: %s' % (req, ','.join(band_ctl))) + raise KeyError(f'{req!r} is not a valid bandwidth setting. Try one of: {",".join(band_ctl)}') k = band_ctl[req] _lib.opus_encoder_ctl(self._state, CTL_SET_BANDWIDTH, k) def set_signal_type(self, req): if req not in signal_ctl: - raise KeyError('%r is not a valid signal setting. Try one of: %s' % (req, ','.join(signal_ctl))) + raise KeyError(f'{req!r} is not a valid bandwidth setting. Try one of: {",".join(signal_ctl)}') k = signal_ctl[req] _lib.opus_encoder_ctl(self._state, CTL_SET_SIGNAL, k) |