From 6d6e5fc28f5cb4543cea9f7280831e4118b91e41 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sun, 8 Jan 2023 15:53:55 -0500 Subject: [PATCH 1/2] In Python tests, use host-endian-independent dtypes --- tests/py_test.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/py_test.py b/tests/py_test.py index 204a96dd4be..70cf07b989b 100644 --- a/tests/py_test.py +++ b/tests/py_test.py @@ -701,18 +701,18 @@ def asserter(stmt): import numpy as np asserter(monster.InventoryAsNumpy().sum() == 10) - asserter(monster.InventoryAsNumpy().dtype == np.dtype('uint8')) + asserter(monster.InventoryAsNumpy().dtype == np.dtype(' Date: Sun, 8 Jan 2023 19:56:42 -0500 Subject: [PATCH 2/2] Fix host endianness dependence in Python flexbuffers --- python/flatbuffers/flexbuffers.py | 10 +++++----- tests/py_flexbuffers_test.py | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/python/flatbuffers/flexbuffers.py b/python/flatbuffers/flexbuffers.py index aaa02fdaf3f..34d42a6986c 100644 --- a/python/flatbuffers/flexbuffers.py +++ b/python/flatbuffers/flexbuffers.py @@ -75,7 +75,7 @@ def I(value): @staticmethod def F(value): """Returns the `BitWidth` to encode floating point value.""" - if struct.unpack('f', struct.pack('f', value))[0] == value: + if struct.unpack('