[Python-checkins] cpython: Issue #27830: Remove unused _PyStack_AsDict()

victor.stinner python-checkins at python.org
Mon Sep 5 14:44:47 EDT 2016


https://hg.python.org/cpython/rev/119af59911a0
changeset:   103052:119af59911a0
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Mon Sep 05 11:43:18 2016 -0700
summary:
  Issue #27830: Remove unused _PyStack_AsDict()

I forgot to remove this function, I made a mistake in my revert.

files:
  Objects/abstract.c |  34 ----------------------------------
  1 files changed, 0 insertions(+), 34 deletions(-)


diff --git a/Objects/abstract.c b/Objects/abstract.c
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -2309,40 +2309,6 @@
     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. */
 PyObject *
 _PyObject_Call_Prepend(PyObject *func,

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list