diff options
author | INADA Naoki <methane@users.noreply.github.com> | 2017-03-01 12:14:43 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-01 12:14:43 (GMT) |
commit | 023532e558bb0c5bf60195aebbafe63a0bebd85e (patch) | |
tree | 663a712ef23eb7b0ab75f540f39b989bbb1d0686 /Python | |
parent | 1b93ed4f3ea5a4ac9786f15870e9b2812ba87cb1 (diff) | |
download | cpython-023532e558bb0c5bf60195aebbafe63a0bebd85e.zip cpython-023532e558bb0c5bf60195aebbafe63a0bebd85e.tar.gz cpython-023532e558bb0c5bf60195aebbafe63a0bebd85e.tar.bz2 |
bpo-29684: Fix minor regression of PyEval_CallObjectWithKeywords. (GH-378)
Diffstat (limited to 'Python')
-rw-r--r-- | Python/ceval.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 8366735..02bc67e 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -4699,11 +4699,7 @@ PyEval_CallObjectWithKeywords(PyObject *func, PyObject *args, PyObject *kwargs) assert(!PyErr_Occurred()); #endif - if (args == NULL) { - return _PyObject_FastCallDict(func, NULL, 0, kwargs); - } - - if (!PyTuple_Check(args)) { + if (args != NULL && !PyTuple_Check(args)) { PyErr_SetString(PyExc_TypeError, "argument list must be a tuple"); return NULL; @@ -4715,7 +4711,12 @@ PyEval_CallObjectWithKeywords(PyObject *func, PyObject *args, PyObject *kwargs) return NULL; } - return PyObject_Call(func, args, kwargs); + if (args == NULL) { + return _PyObject_FastCallDict(func, NULL, 0, kwargs); + } + else { + return PyObject_Call(func, args, kwargs); + } } const char * |