[Python-3000-checkins] r56971 - python/branches/py3k/Modules/_tkinter.c

martin.v.loewis python-3000-checkins at python.org
Mon Aug 13 07:41:43 CEST 2007


Author: martin.v.loewis
Date: Mon Aug 13 07:41:41 2007
New Revision: 56971

Modified:
   python/branches/py3k/Modules/_tkinter.c
Log:
Use Tcl_SetObjResult instead of Tcl_SetResult.


Modified: python/branches/py3k/Modules/_tkinter.c
==============================================================================
--- python/branches/py3k/Modules/_tkinter.c	(original)
+++ python/branches/py3k/Modules/_tkinter.c	Mon Aug 13 07:41:41 2007
@@ -1946,9 +1946,9 @@
 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 @@
 	if (res == NULL)
 		return PythonCmd_Error(interp);
 
-	if (!(tmp = PyList_New(0))) {
+	tres = AsObj(res);
+	if (tres == NULL) {
 		Py_DECREF(res);
 		return PythonCmd_Error(interp);
 	}
-
-	s = AsString(res, tmp);
-	if (s == 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
 


More information about the Python-3000-checkins mailing list