From 0aecb032117f79055d91e00b68f8785346f44f6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Zabo=C5=82otny?= Date: Sun, 18 Jul 2021 20:37:51 +0200 Subject: [PATCH] =?UTF-8?q?To=20achieve=20correct=20operation=20on=20a=20S?= =?UTF-8?q?TM32=20=C2=B5Processor,=20I=20ad=20to=20disable=20two=20tests.?= =?UTF-8?q?=20The=20first=20one=20used=20sys.float=5Finfo=20(not=20availab?= =?UTF-8?q?le=20in=20=C2=B5Python),=20the=20second=20one=20used=20collecti?= =?UTF-8?q?on.Hashable=20(also=20not=20available=20ib=20=C2=B5Python).=20N?= =?UTF-8?q?ow=20the=20packing=20and=20unpacking=20seems=20to=20work=20on?= =?UTF-8?q?=20STM32.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- umsgpack.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/umsgpack.py b/umsgpack.py index 0556268..df0eec5 100644 --- a/umsgpack.py +++ b/umsgpack.py @@ -766,9 +766,10 @@ def _unpack_map(code, fp, options): if isinstance(k, list): # Attempt to convert list into a hashable tuple k = _deep_list_to_tuple(k) - elif not isinstance(k, collections.Hashable): - raise UnhashableKeyException( - "encountered unhashable key: %s, %s" % (str(k), str(type(k)))) + # The test below does not work in MicroPython + #elif not isinstance(k, collections.Hashable): + # raise UnhashableKeyException( + # "encountered unhashable key: %s, %s" % (str(k), str(type(k)))) elif k in d: raise DuplicateKeyException( "encountered duplicate key: %s, %s" % (str(k), str(type(k)))) @@ -989,11 +990,11 @@ def __init(): compatibility = False # Auto-detect system float precision - if sys.float_info.mant_dig == 53: - _float_precision = "double" - else: - _float_precision = "single" - + #if sys.float_info.mant_dig == 53: + # _float_precision = "double" + #else: + # _float_precision = "single" + _float_precision = "double" # Map packb and unpackb to the appropriate version if sys.version_info[0] == 3: pack = _pack3