bpo-39884: Add method name in "bad call flags" error (GH-18944) (GH-18956)
PyDescr_NewMethod() and PyCFunction_NewEx() now include the method
name in the SystemError "bad call flags" error message to ease debug.
(cherry picked from commit c7d2d69d95
)
This commit is contained in:
parent
ab9c729121
commit
03ac090c5f
|
@ -0,0 +1,2 @@
|
|||
:c:func:`PyDescr_NewMethod` and :c:func:`PyCFunction_NewEx` now include the
|
||||
method name in the SystemError "bad call flags" error message to ease debug.
|
|
@ -892,7 +892,8 @@ PyDescr_NewMethod(PyTypeObject *type, PyMethodDef *method)
|
|||
vectorcall = method_vectorcall_O;
|
||||
break;
|
||||
default:
|
||||
PyErr_SetString(PyExc_SystemError, "bad call flags");
|
||||
PyErr_Format(PyExc_SystemError,
|
||||
"%s() method: bad call flags", method->ml_name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -62,7 +62,8 @@ PyCFunction_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module)
|
|||
vectorcall = cfunction_vectorcall_O;
|
||||
break;
|
||||
default:
|
||||
PyErr_SetString(PyExc_SystemError, "bad call flags");
|
||||
PyErr_Format(PyExc_SystemError,
|
||||
"%s() method: bad call flags", ml->ml_name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue