summaryrefslogtreecommitdiffstats
path: root/Modules/_tkinter.c
diff options
context:
space:
mode:
authorINADA Naoki <methane@users.noreply.github.com>2017-02-16 00:26:01 (GMT)
committerGitHub <noreply@github.com>2017-02-16 00:26:01 (GMT)
commit72dccde884d89586b0cafd990675b7e21720a81f (patch)
treeb0a57ee76f067c30869089792f385d950dcf22d5 /Modules/_tkinter.c
parent72e81d00eee685cfe33aaddf2aa9feef2d07591f (diff)
downloadcpython-72dccde884d89586b0cafd990675b7e21720a81f.zip
cpython-72dccde884d89586b0cafd990675b7e21720a81f.tar.gz
cpython-72dccde884d89586b0cafd990675b7e21720a81f.tar.bz2
bpo-29548: Fix some inefficient call API usage (GH-97)
Diffstat (limited to 'Modules/_tkinter.c')
-rw-r--r--Modules/_tkinter.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index f69a4df..1abc0e2 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -2417,7 +2417,7 @@ PythonCmd(ClientData clientData, Tcl_Interp *interp, int argc, const char *argv[
}
PyTuple_SET_ITEM(arg, i, s);
}
- res = PyEval_CallObject(func, arg);
+ res = PyObject_Call(func, arg, NULL);
Py_DECREF(arg);
if (res == NULL)
@@ -2661,16 +2661,13 @@ static void
FileHandler(ClientData clientData, int mask)
{
FileHandler_ClientData *data = (FileHandler_ClientData *)clientData;
- PyObject *func, *file, *arg, *res;
+ PyObject *func, *file, *res;
ENTER_PYTHON
func = data->func;
file = data->file;
- arg = Py_BuildValue("(Oi)", file, (long) mask);
- res = PyEval_CallObject(func, arg);
- Py_DECREF(arg);
-
+ res = PyObject_CallFunction(func, "Oi", file, mask);
if (res == NULL) {
errorInCmd = 1;
PyErr_Fetch(&excInCmd, &valInCmd, &trbInCmd);
@@ -2840,7 +2837,7 @@ TimerHandler(ClientData clientData)
ENTER_PYTHON
- res = PyEval_CallObject(func, NULL);
+ res = _PyObject_CallNoArg(func);
Py_DECREF(func);
Py_DECREF(v); /* See Tktt_New() */