diff options
-rw-r--r-- | Modules/_ctypes/_ctypes.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index 4728874..0f11e01 100644 --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -1168,7 +1168,11 @@ PyCPointerType_from_param(PyObject *type, PyObject *value) */ StgDictObject *v = PyObject_stgdict(value); assert(v); /* Cannot be NULL for pointer or array objects */ - if (PyObject_IsSubclass(v->proto, typedict->proto)) { + int ret = PyObject_IsSubclass(v->proto, typedict->proto); + if (ret < 0) { + return NULL; + } + if (ret) { Py_INCREF(value); return value; } |