diff Modules/_tkinter.c @ 30637:a3015bba3999 2.3

Check for TclError when reading variables. Fixes #807314.
author Martin v. Löwis <martin@v.loewis.de>
date Fri, 03 Oct 2003 17:11:45 +0000
parents 1ab9978123be
children 86fdf8fe7f17
line wrap: on
line diff
--- a/Modules/_tkinter.c	Fri Oct 03 15:20:30 2003 +0000
+++ b/Modules/_tkinter.c	Fri Oct 03 17:11:45 2003 +0000
@@ -1647,11 +1647,15 @@
 	ENTER_TCL
 	tres = Tcl_GetVar2Ex(Tkapp_Interp(self), name1, name2, flags);
 	ENTER_OVERLAP
-	if (((TkappObject*)self)->wantobjects) {
-		res = FromObj(self, tres);
-	}
-	else {
-		res = PyString_FromString(Tcl_GetString(tres));
+	if (tres == NULL) {
+		PyErr_SetString(Tkinter_TclError, Tcl_GetStringResult(Tkapp_Interp(self)));
+	} else {
+		if (((TkappObject*)self)->wantobjects) {
+			res = FromObj(self, tres);
+		}
+		else {
+			res = PyString_FromString(Tcl_GetString(tres));
+		}
 	}
 	LEAVE_OVERLAP_TCL
 	return res;