From d031d061b96acb59567d80f91c1d07227acaeec0 Mon Sep 17 00:00:00 2001 From: mmckerns Date: Fri, 30 Jun 2023 20:15:04 -0400 Subject: [PATCH] fix #601: avoid abort trap on CFunctionType --- dill/_objects.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dill/_objects.py b/dill/_objects.py index 4877fe89..0107a921 100644 --- a/dill/_objects.py +++ b/dill/_objects.py @@ -484,7 +484,8 @@ class _Struct(ctypes.Structure): z = a if IS_PYPY else x z['FieldType'] = _field = _Struct._field z['CFUNCTYPEType'] = _cfunc = ctypes.CFUNCTYPE(ctypes.c_char) - x['CFunctionType'] = _cfunc(str) + if sys.hexversion < 0x30c00b3: + x['CFunctionType'] = _cfunc(str) del z # numeric and mathematical types (CH 9) a['MethodCallerType'] = operator.methodcaller('mro') # 2.6