Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change bytearray to bytes #93

Merged
merged 1 commit into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions EosLib/format/decode_factory.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import Any
from EosLib.format.definitions import Type


class DecodeFactory:
def __init__(self):
self._decoders: dict[Type, dict] = {}
Expand All @@ -12,6 +13,8 @@ def decode(self, data_format: Type, data: Any):
decoders_for_format = self._decoders.get(data_format)
if decoders_for_format is None:
raise TypeError(f"No decoders found for format type {Type(data_format).name}")
if isinstance(data, bytearray):
data = bytes(data)
decoder = decoders_for_format.get(type(data))
if decoder is None:
raise TypeError(f"No decoder found for format type {Type(data_format).name} for data type {type(data)}."
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from setuptools import find_packages

setup(name='EosLib',
version='4.3.3',
version='4.3.4',
description='Library of shared code between EosPayload and EosGround',
author='Lightning From The Edge of Space',
author_email='[email protected]',
Expand Down