summaryrefslogtreecommitdiffstats
path: root/Objects/call.c
diff options
context:
space:
mode:
authorJeroen Demeyer <J.Demeyer@UGent.be>2019-07-11 15:57:32 (GMT)
committerInada Naoki <songofacandy@gmail.com>2019-07-11 15:57:32 (GMT)
commit1dbd084f1f68d7293718b663df675cfbd0c65712 (patch)
tree134dd51d1364168e6f55f6dae348213dbdd136d7 /Objects/call.c
parent9b5ce62cac27fec9dea473865d79c2c654312957 (diff)
downloadcpython-1dbd084f1f68d7293718b663df675cfbd0c65712.zip
cpython-1dbd084f1f68d7293718b663df675cfbd0c65712.tar.gz
cpython-1dbd084f1f68d7293718b663df675cfbd0c65712.tar.bz2
bpo-29548: no longer use PyEval_Call* functions (GH-14683)
Diffstat (limited to 'Objects/call.c')
-rw-r--r--Objects/call.c11
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);
}