Skip to content
Merged
Prev Previous commit
Next Next commit
Use _PyObject_LookupAttrId().
  • Loading branch information
serhiy-storchaka committed Feb 1, 2018
commit e10a467028361a71ff0b06fff86217cc42ae4fb6
10 changes: 4 additions & 6 deletions Modules/_ctypes/_ctypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -2342,12 +2342,10 @@ make_funcptrtype_dict(StgDictObject *stgdict)
}
Py_INCREF(ob);
stgdict->restype = ob;
stgdict->checker = _PyObject_GetAttrId(ob, &PyId__check_retval_);
if (stgdict->checker == NULL) {
if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
return -1;
}
PyErr_Clear();
if (_PyObject_LookupAttrId(ob, &PyId__check_retval_,
&stgdict->checker) < 0)
{
return -1;
}
}
else if (PyErr_Occurred()) {
Expand Down