mirror of
https://github.com/python/cpython.git
synced 2026-01-06 23:42:34 +00:00
Issue #19437: Fix PyCFuncPtrType constructor, handle
_ctypes_alloc_format_string() failure
This commit is contained in:
parent
a215002453
commit
e75996a77c
1 changed files with 4 additions and 0 deletions
|
|
@ -2245,6 +2245,10 @@ PyCFuncPtrType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
|||
argtypes would be a ctypes type).
|
||||
*/
|
||||
stgdict->format = _ctypes_alloc_format_string(NULL, "X{}");
|
||||
if (stgdict->format == NULL) {
|
||||
Py_DECREF((PyObject *)stgdict);
|
||||
return NULL;
|
||||
}
|
||||
stgdict->flags |= TYPEFLAG_ISPOINTER;
|
||||
|
||||
/* create the new instance (which is a class,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue