mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
Issue #27830: Remove unused _PyStack_AsDict()
I forgot to remove this function, I made a mistake in my revert.
This commit is contained in:
parent
ff79396c83
commit
2250c4cb81
1 changed files with 0 additions and 34 deletions
|
|
@ -2309,40 +2309,6 @@ exit:
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
|
||||||
_PyStack_AsDict(PyObject **stack, Py_ssize_t nkwargs, PyObject *func)
|
|
||||||
{
|
|
||||||
PyObject *kwdict;
|
|
||||||
|
|
||||||
kwdict = PyDict_New();
|
|
||||||
if (kwdict == NULL) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (--nkwargs >= 0) {
|
|
||||||
int err;
|
|
||||||
PyObject *key = *stack++;
|
|
||||||
PyObject *value = *stack++;
|
|
||||||
if (PyDict_GetItem(kwdict, key) != NULL) {
|
|
||||||
PyErr_Format(PyExc_TypeError,
|
|
||||||
"%.200s%s got multiple values "
|
|
||||||
"for keyword argument '%U'",
|
|
||||||
PyEval_GetFuncName(func),
|
|
||||||
PyEval_GetFuncDesc(func),
|
|
||||||
key);
|
|
||||||
Py_DECREF(kwdict);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
err = PyDict_SetItem(kwdict, key, value);
|
|
||||||
if (err) {
|
|
||||||
Py_DECREF(kwdict);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return kwdict;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Positional arguments are obj followed args. */
|
/* Positional arguments are obj followed args. */
|
||||||
PyObject *
|
PyObject *
|
||||||
_PyObject_Call_Prepend(PyObject *func,
|
_PyObject_Call_Prepend(PyObject *func,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue