summaryrefslogtreecommitdiff
path: root/Include/abstract.h
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-01-17 01:57:29 +0100
committerVictor Stinner <victor.stinner@gmail.com>2017-01-17 01:57:29 +0100
commit998c20962ca3e2e693c1635efe76c0144dde76fc (patch)
tree400922db5ea9f99e4e1bdabe23a02fc439ade5ed /Include/abstract.h
parent29d39cc8f50f314a62226d69ac014cbd0bd66792 (diff)
downloadcpython-git-998c20962ca3e2e693c1635efe76c0144dde76fc.tar.gz
_PyStack_UnpackDict() now returns -1 on error
Issue #29286. Change _PyStack_UnpackDict() prototype to be able to notify of failure when args is NULL.
Diffstat (limited to 'Include/abstract.h')
-rw-r--r--Include/abstract.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/Include/abstract.h b/Include/abstract.h
index 43bf251222..961279d470 100644
--- a/Include/abstract.h
+++ b/Include/abstract.h
@@ -177,20 +177,23 @@ PyAPI_FUNC(PyObject *) _PyStack_AsDict(
PyObject **values,
PyObject *kwnames);
-/* Convert (args, nargs, kwargs) into a (stack, nargs, kwnames).
+/* Convert (args, nargs, kwargs: dict) into a (stack, nargs, kwnames: tuple).
- Return a new stack which should be released by PyMem_Free(), or return
- args unchanged if kwargs is NULL or an empty dictionary.
+ Return 0 on success, raise an exception and return -1 on error.
+
+ Write the new stack into *p_stack. If *p_stack is differen than args, it
+ must be released by PyMem_Free().
The stack uses borrowed references.
The type of keyword keys is not checked, these checks should be done
later (ex: _PyArg_ParseStackAndKeywords). */
-PyAPI_FUNC(PyObject **) _PyStack_UnpackDict(
+PyAPI_FUNC(int) _PyStack_UnpackDict(
PyObject **args,
Py_ssize_t nargs,
PyObject *kwargs,
- PyObject **kwnames,
+ PyObject ***p_stack,
+ PyObject **p_kwnames,
PyObject *func);
/* Suggested size (number of positional arguments) for arrays of PyObject*