summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-03-12 08:38:11 +0100
committerGitHub <noreply@github.com>2020-03-12 08:38:11 +0100
commitc7d2d69d95b263ee5f83511bc6fbe53acdc24ea3 (patch)
tree216d0a5fa669354114a2500bc0cd0d623d61de44 /Objects/descrobject.c
parentSimplify defaultdict.__or__ (#18931) (diff)
downloadcpython-c7d2d69d95b263ee5f83511bc6fbe53acdc24ea3.tar.gz
cpython-c7d2d69d95b263ee5f83511bc6fbe53acdc24ea3.tar.bz2
cpython-c7d2d69d95b263ee5f83511bc6fbe53acdc24ea3.zip
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.
Diffstat (limited to 'Objects/descrobject.c')
-rw-r--r--Objects/descrobject.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/descrobject.c b/Objects/descrobject.c
index 4ebbb74151a..b448ec64268 100644
--- a/Objects/descrobject.c
+++ b/Objects/descrobject.c
@@ -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;
}