Skip to content

Commit

Permalink
bpo-39884: Add method name in "bad call flags" error (GH-18944) (GH-1…
Browse files Browse the repository at this point in the history
…8957)

_PyMethodDef_RawFastCallDict() and _PyMethodDef_RawFastCallKeywords()
now include the method name in the SystemError "bad call flags" error
message to ease debug.

(cherry picked from commit c7d2d69)
  • Loading branch information
vstinner committed Mar 12, 2020
1 parent 6f4e7fc commit 6a12676
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
:c:func:`_PyMethodDef_RawFastCallDict` and
:c:func:`_PyMethodDef_RawFastCallKeywords` now include the method name in the
SystemError "bad call flags" error message to ease debug.
10 changes: 4 additions & 6 deletions Objects/call.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,9 +554,8 @@ _PyMethodDef_RawFastCallDict(PyMethodDef *method, PyObject *self,
}

default:
PyErr_SetString(PyExc_SystemError,
"Bad call flags in _PyMethodDef_RawFastCallDict. "
"METH_OLDARGS is no longer supported!");
PyErr_Format(PyExc_SystemError,
"%s() method: bad call flags", method->ml_name);
goto exit;
}

Expand Down Expand Up @@ -702,9 +701,8 @@ _PyMethodDef_RawFastCallKeywords(PyMethodDef *method, PyObject *self,
}

default:
PyErr_SetString(PyExc_SystemError,
"Bad call flags in _PyMethodDef_RawFastCallKeywords. "
"METH_OLDARGS is no longer supported!");
PyErr_Format(PyExc_SystemError,
"%s() method: bad call flags", method->ml_name);
goto exit;
}

Expand Down

0 comments on commit 6a12676

Please sign in to comment.