]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Only return objects if wantobjects is set in GetVar.
authorMartin v. Löwis <martin@v.loewis.de>
Mon, 19 May 2003 19:57:42 +0000 (19:57 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Mon, 19 May 2003 19:57:42 +0000 (19:57 +0000)
Modules/_tkinter.c

index 288ed153e97573d1ae51acfc32b83df27da745b6..fbc6ec10c9b69d05f1a0e3cde460225c2a1c0eb0 100644 (file)
@@ -1647,7 +1647,12 @@ GetVar(PyObject *self, PyObject *args, int flags)
        ENTER_TCL
        tres = Tcl_GetVar2Ex(Tkapp_Interp(self), name1, name2, flags);
        ENTER_OVERLAP
-       res = FromObj(self, tres);
+       if (((TkappObject*)self)->wantobjects) {
+               res = FromObj(self, tres);
+       }
+       else {
+               res = PyString_FromString(Tcl_GetString(tres));
+       }
        LEAVE_OVERLAP_TCL
        return res;
 }