diff options
author | Sergey B Kirpichev <skirpichev@gmail.com> | 2024-07-03 09:08:11 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-03 09:08:11 (GMT) |
commit | 51c4a324c037fb2e31640202243fd1c8b33800d5 (patch) | |
tree | 08621c55e9f848fc08e22852fb54e0ccc1d16d97 /Lib/ctypes | |
parent | c9bdfbe86853fcf5f2b7dce3a50b383e23384ed2 (diff) | |
download | cpython-51c4a324c037fb2e31640202243fd1c8b33800d5.zip cpython-51c4a324c037fb2e31640202243fd1c8b33800d5.tar.gz cpython-51c4a324c037fb2e31640202243fd1c8b33800d5.tar.bz2 |
gh-61103: Support float and long double complex types in ctypes module (#121248)
This amends 6988ff02a5: memory allocation for
stginfo->ffi_type_pointer.elements in PyCSimpleType_init() should be
more generic (perhaps someday fmt->pffi_type->elements will be not a
two-elements array).
It should finally resolve #61103.
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Diffstat (limited to 'Lib/ctypes')
-rw-r--r-- | Lib/ctypes/__init__.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/ctypes/__init__.py b/Lib/ctypes/__init__.py index d2e6a8b..721522c 100644 --- a/Lib/ctypes/__init__.py +++ b/Lib/ctypes/__init__.py @@ -208,6 +208,10 @@ if sizeof(c_longdouble) == sizeof(c_double): try: class c_double_complex(_SimpleCData): _type_ = "C" + class c_float_complex(_SimpleCData): + _type_ = "E" + class c_longdouble_complex(_SimpleCData): + _type_ = "F" except AttributeError: pass |