8000 bpo-37645: add new function _PyObject_FunctionStr() by jdemeyer · Pull Request #14890 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-37645: add new function _PyObject_FunctionStr() #14890

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Nov 5, 2019
Prev Previous commit
Merge branch 'master' to resolve PyErr_Format/_PyErr_Format conflict
The conflicting change in master is to use _PyErr_Format
(with explicit thread state argument) instead of PyErr_Format
  • Loading branch information
encukou committed Nov 5, 2019
commit 0307ce95ac27ad3f2d103f30503ca6ccbe91268e
6 changes: 3 additions & 3 deletions Objects/methodobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ cfunction_check_kwargs(PyThreadState *tstate, PyObject *func, PyObject *kwnames)
if (kwnames && PyTuple_GET_SIZE(kwnames)) {
PyObject *funcstr = _PyObject_FunctionStr(func);
if (funcstr != NULL) {
PyErr_Format(PyExc_TypeError,
_PyErr_Format(tstate, PyExc_TypeError,
"%U takes no keyword arguments", funcstr);
Py_DECREF(funcstr);
}
Expand Down Expand Up @@ -411,7 +411,7 @@ cfunction_vectorcall_NOARGS(
if (nargs != 0) {
PyObject *funcstr = _PyObject_FunctionStr(func);
if (funcstr != NULL) {
PyErr_Format(PyExc_TypeError,
_PyErr_Format(tstate, PyExc_TypeError,
"%U takes no arguments (%zd given)", funcstr, nargs);
Py_DECREF(funcstr);
}
Expand All @@ -438,7 +438,7 @@ cfunction_vectorcall_O(
if (nargs != 1) {
PyObject *funcstr = _PyObject_FunctionStr(func);
if (funcstr != NULL) {
PyErr_Format(PyExc_TypeError,
_PyErr_Format(tstate, PyExc_TypeError,
"%U takes exactly one argument (%zd given)", funcstr, nargs);
Py_DECREF(funcstr);
}
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.
0