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.
diff --git a/Objects/methodobject.c b/Objects/methodobject.c
index 0d45705..16abded 100644
--- a/Objects/methodobject.c
+++ b/Objects/methodobject.c
@@ -56,7 +56,8 @@
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;
}