diff options
Diffstat (limited to 'Objects/call.c')
-rw-r--r-- | Objects/call.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Objects/call.c b/Objects/call.c index df90595..7d91789 100644 --- a/Objects/call.c +++ b/Objects/call.c @@ -457,7 +457,16 @@ PyEval_CallObjectWithKeywords(PyObject *callable, PyObject * PyObject_CallObject(PyObject *callable, PyObject *args) { - return PyEval_CallObjectWithKeywords(callable, args, NULL); + assert(!PyErr_Occurred()); + if (args == NULL) { + return _PyObject_CallNoArg(callable); + } + if (!PyTuple_Check(args)) { + PyErr_SetString(PyExc_TypeError, + "argument list must be a tuple"); + return NULL; + } + return PyObject_Call(callable, args, NULL); } |