diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2007-08-13 05:41:41 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2007-08-13 05:41:41 (GMT) |
commit | 50fb866df8b695eed751ca553c137c32f2a33151 (patch) | |
tree | cdb98435ca2f0446e9aac666b1237ef474748d84 | |
parent | 88b44da944bcdd6c688c0ee6a23493934ad06298 (diff) | |
download | cpython-50fb866df8b695eed751ca553c137c32f2a33151.zip cpython-50fb866df8b695eed751ca553c137c32f2a33151.tar.gz cpython-50fb866df8b695eed751ca553c137c32f2a33151.tar.bz2 |
Use Tcl_SetObjResult instead of Tcl_SetResult.
-rw-r--r-- | Modules/_tkinter.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index df281cd..93e4a98 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -1946,9 +1946,9 @@ static int PythonCmd(ClientData clientData, Tcl_Interp *interp, int argc, char *argv[]) { PythonCmd_ClientData *data = (PythonCmd_ClientData *)clientData; - PyObject *self, *func, *arg, *res, *tmp; + PyObject *self, *func, *arg, *res; int i, rv; - char *s; + Tcl_Obj *tres; ENTER_PYTHON @@ -1975,24 +1975,17 @@ PythonCmd(ClientData clientData, Tcl_Interp *interp, int argc, char *argv[]) if (res == NULL) return PythonCmd_Error(interp); - if (!(tmp = PyList_New(0))) { - Py_DECREF(res); - return PythonCmd_Error(interp); - } - - s = AsString(res, tmp); - if (s == NULL) { + tres = AsObj(res); + if (tres == NULL) { Py_DECREF(res); - Py_DECREF(tmp); return PythonCmd_Error(interp); } else { - Tcl_SetResult(Tkapp_Interp(self), s, TCL_VOLATILE); + Tcl_SetObjResult(Tkapp_Interp(self), tres); rv = TCL_OK; } Py_DECREF(res); - Py_DECREF(tmp); LEAVE_PYTHON |