From c464c9768b9d6398350c88782f1a78142cb4687f Mon Sep 17 00:00:00 2001 From: Matthew Pope Date: Wed, 26 Jul 2023 16:18:40 -0700 Subject: [PATCH] Fix faulty c_ext logic in ion_load_dump --- amazon/ionbenchmark/ion_load_dump.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/amazon/ionbenchmark/ion_load_dump.py b/amazon/ionbenchmark/ion_load_dump.py index 2cd4f7e39..1505d8d82 100644 --- a/amazon/ionbenchmark/ion_load_dump.py +++ b/amazon/ionbenchmark/ion_load_dump.py @@ -15,7 +15,11 @@ class IonLoadDump: def __init__(self, binary, c_ext=None): self._binary = binary self._single_value = False - self._c_ext = c_ext if c_ext is not None else True + + import platform + _is_c_ext_supported = platform.python_implementation() == "CPython" + _resolved_c_ext_argument = c_ext if c_ext is not None else True + self._c_ext = _resolved_c_ext_argument and _is_c_ext_supported def loads(self, s): ion.c_ext = self._c_ext