bpo-39884: Add method name in "bad call flags" error (GH-18944)
PyDescr_NewMethod() and PyCFunction_NewEx() now include the method name in the SystemError "bad call flags" error message to ease debug.
This commit is contained in:
parent
1dd3794b19
commit
c7d2d69d95
|
@ -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.
|
|
@ -888,7 +888,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;
|
||||
}
|
||||
|
||||
|
|
|
@ -56,7 +56,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