Skip to content

Commit

Permalink
Document that _PyFunction_FastCallDict() must copy kwargs
Browse files Browse the repository at this point in the history
Issue python#29318: Caller and callee functions must not share the dictionary:
kwargs must be copied.
  • Loading branch information
vstinner committed Feb 1, 2017
1 parent f94b68a commit 122fb56
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -5039,6 +5039,8 @@ _PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs,
if (nk != 0) {
Py_ssize_t pos, i;

/* Issue #29318: Caller and callee functions must not share the
dictionary: kwargs must be copied. */
kwtuple = PyTuple_New(2 * nk);
if (kwtuple == NULL) {
return NULL;
Expand Down

0 comments on commit 122fb56

Please sign in to comment.