From c5a533622ecb28d807c6f8d1647e6b8b9acc012c Mon Sep 17 00:00:00 2001 From: VanL15 <94021265+VanL15@users.noreply.github.com> Date: Fri, 10 Nov 2023 16:46:57 -0500 Subject: [PATCH] change bytearray to bytes --- EosLib/format/decode_factory.py | 3 +++ setup.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/EosLib/format/decode_factory.py b/EosLib/format/decode_factory.py index add0950..d45f5bc 100644 --- a/EosLib/format/decode_factory.py +++ b/EosLib/format/decode_factory.py @@ -1,6 +1,7 @@ from typing import Any from EosLib.format.definitions import Type + class DecodeFactory: def __init__(self): self._decoders: dict[Type, dict] = {} @@ -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)}." diff --git a/setup.py b/setup.py index 8f94431..02bf87f 100644 --- a/setup.py +++ b/setup.py @@ -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='thomasmholder@gmail.com',