mirror of https://github.com/python/cpython
Fix a potential 'SystemError: NULL result without error'.
NULL may be a valid return value from PyLong_AsVoidPtr. Will backport to release25-maint.
This commit is contained in:
parent
c682614df0
commit
43617bc610
|
@ -2899,7 +2899,7 @@ CFuncPtr_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
|||
|| PyLong_Check(PyTuple_GET_ITEM(args, 0)))) {
|
||||
CDataObject *ob;
|
||||
void *ptr = PyLong_AsVoidPtr(PyTuple_GET_ITEM(args, 0));
|
||||
if (ptr == NULL)
|
||||
if (ptr == NULL && PyErr_Occurred())
|
||||
return NULL;
|
||||
ob = (CDataObject *)GenericCData_new(type, args, kwds);
|
||||
if (ob == NULL)
|
||||
|
|
Loading…
Reference in New Issue