]> granicus.if.org Git - python/commitdiff
Add back an obscure "feature" to the Obj version of Tkapp_Call(): a
authorGuido van Rossum <guido@python.org>
Fri, 31 Mar 2000 03:29:39 +0000 (03:29 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 31 Mar 2000 03:29:39 +0000 (03:29 +0000)
None in an argument list *terminates* the argument list: further
arguments are *ignored*.  This isn't kosher, but too much code relies
on it, implicitly.  For example, IDLE was pretty broken.

Modules/_tkinter.c

index 47edf626ebad071596f609e8d3e8933620bc7a18..601a70c56e570d06790ac8a02e38269a0cc23e75 100644 (file)
@@ -604,6 +604,10 @@ Tkapp_Call(self, args)
 
                for (i = 0; i < objc; i++) {
                        PyObject *v = PyTuple_GetItem(args, i);
+                       if (v == Py_None) {
+                               objc = i;
+                               break;
+                       }
                        objv[i] = AsObj(v);
                        if (!objv[i])
                                goto finally;