diff --git a/bemani/protocol/binary.py b/bemani/protocol/binary.py index 284c43b..0ec6ac3 100644 --- a/bemani/protocol/binary.py +++ b/bemani/protocol/binary.py @@ -817,8 +817,4 @@ class BinaryEncoding: encoder = BinaryEncoder(tree, self.__sanitize_encoding(encoding)) data = encoder.get_data() - - if data is not None: - return struct.pack(">BBBB", BinaryEncoding.MAGIC, BinaryEncoding.COMPRESSED_WITH_DATA, encoding_magic, (~encoding_magic & 0xFF)) + data - else: - return None + return struct.pack(">BBBB", BinaryEncoding.MAGIC, BinaryEncoding.COMPRESSED_WITH_DATA, encoding_magic, (~encoding_magic & 0xFF)) + data diff --git a/bemani/protocol/protocol.py b/bemani/protocol/protocol.py index f302abd..c911d57 100644 --- a/bemani/protocol/protocol.py +++ b/bemani/protocol/protocol.py @@ -80,9 +80,6 @@ class EAmuseProtocol: Returns: binary string representing transformed data """ - if data is None: - return None - key: Optional[bytes] = None if encryption_key: # Key is concatenated with the shared secret above @@ -130,9 +127,6 @@ class EAmuseProtocol: Returns: binary string representing transformed data """ - if data is None: - return None - if compression is None or compression == 'none': # This isn't compressed return data @@ -156,9 +150,6 @@ class EAmuseProtocol: Returns: binary string representing transformed data """ - if data is None: - return None - if compression is None or compression == 'none': # This isn't compressed return data