From fb2312e844d5ba3d0f855e49a18dcb2ba687f8a4 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Fri, 16 Apr 2021 23:50:13 +0000 Subject: [PATCH 1/2] Remove methods with unnecessary super delegation. --- librespot/audio/AbsChunkedInputStream.py | 2 -- librespot/audio/AudioKeyManager.py | 3 +-- librespot/audio/cdn/CdnManager.py | 6 +----- librespot/core/Session.py | 3 --- librespot/metadata/SpotifyId.py | 3 +-- librespot/standard/DataInputStream.py | 2 -- 6 files changed, 3 insertions(+), 16 deletions(-) diff --git a/librespot/audio/AbsChunkedInputStream.py b/librespot/audio/AbsChunkedInputStream.py index af493d5..fcd5f1e 100644 --- a/librespot/audio/AbsChunkedInputStream.py +++ b/librespot/audio/AbsChunkedInputStream.py @@ -222,8 +222,6 @@ class AbsChunkedInputStream(InputStream, HaltListener): return self._decoded_length class ChunkException(IOError): - def __init__(self, cause): - super().__init__(cause) @staticmethod def from_stream_error(stream_error: int): diff --git a/librespot/audio/AudioKeyManager.py b/librespot/audio/AudioKeyManager.py index 32e5861..aa13c67 100644 --- a/librespot/audio/AudioKeyManager.py +++ b/librespot/audio/AudioKeyManager.py @@ -107,5 +107,4 @@ class AudioKeyManager(PacketsReceiver): return self.reference.get(block=False) class AesKeyException(IOError): - def __init__(self, ex): - super().__init__(ex) + pass diff --git a/librespot/audio/cdn/CdnManager.py b/librespot/audio/cdn/CdnManager.py index 2b8b3c8..53d8a57 100644 --- a/librespot/audio/cdn/CdnManager.py +++ b/librespot/audio/cdn/CdnManager.py @@ -83,8 +83,7 @@ class CdnManager: "Could not retrieve CDN url! result: {}".format(proto.result)) class CdnException(Exception): - def __init__(self, ex): - super().__init__(ex) + pass class InternalResponse: _buffer: bytearray @@ -270,9 +269,6 @@ class CdnManager: self.streamer: CdnManager.Streamer = streamer super().__init__(retry_on_chunk_error) - def close(self) -> None: - super().close() - def buffer(self) -> list[bytearray]: return self.streamer._buffer diff --git a/librespot/core/Session.py b/librespot/core/Session.py index 9e57e61..f392c06 100644 --- a/librespot/core/Session.py +++ b/librespot/core/Session.py @@ -661,9 +661,6 @@ class Session(Closeable, SubListener, DealerClient.MessageListener): class Builder(AbsBuilder): login_credentials: Authentication.LoginCredentials = None - def __init__(self, conf: Session.Configuration = None): - super().__init__(conf) - def stored(self): pass diff --git a/librespot/metadata/SpotifyId.py b/librespot/metadata/SpotifyId.py index 951a95a..21f7710 100644 --- a/librespot/metadata/SpotifyId.py +++ b/librespot/metadata/SpotifyId.py @@ -19,5 +19,4 @@ class SpotifyId: pass class SpotifyIdParsingException(Exception): - def __init__(self, cause): - super().__init__(cause) + pass diff --git a/librespot/standard/DataInputStream.py b/librespot/standard/DataInputStream.py index 0ce84ed..528846c 100644 --- a/librespot/standard/DataInputStream.py +++ b/librespot/standard/DataInputStream.py @@ -4,8 +4,6 @@ from librespot.standard.InputStream import InputStream class DataInputStream(FilterInputStream, DataInput): - def __init__(self, input_stream: InputStream): - super().__init__(input_stream) def read(self, b: bytearray = None, From 42d44c59686420f66852e59daf8aaaf707a82a0f Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Fri, 16 Apr 2021 23:50:23 +0000 Subject: [PATCH 2/2] Format code with yapf --- librespot/audio/AbsChunkedInputStream.py | 1 - librespot/standard/DataInputStream.py | 1 - 2 files changed, 2 deletions(-) diff --git a/librespot/audio/AbsChunkedInputStream.py b/librespot/audio/AbsChunkedInputStream.py index fcd5f1e..73bf452 100644 --- a/librespot/audio/AbsChunkedInputStream.py +++ b/librespot/audio/AbsChunkedInputStream.py @@ -222,7 +222,6 @@ class AbsChunkedInputStream(InputStream, HaltListener): return self._decoded_length class ChunkException(IOError): - @staticmethod def from_stream_error(stream_error: int): return AbsChunkedInputStream.ChunkException( diff --git a/librespot/standard/DataInputStream.py b/librespot/standard/DataInputStream.py index 528846c..aaffe89 100644 --- a/librespot/standard/DataInputStream.py +++ b/librespot/standard/DataInputStream.py @@ -4,7 +4,6 @@ from librespot.standard.InputStream import InputStream class DataInputStream(FilterInputStream, DataInput): - def read(self, b: bytearray = None, offset: int = None,