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/descrobject.c b/Objects/descrobject.c
index 4ebbb74..b448ec6 100644
--- a/Objects/descrobject.c
+++ b/Objects/descrobject.c
@@ -888,7 +888,8 @@
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;
}