]> granicus.if.org Git - python/commitdiff
Many calls to tk.call involve an arglist containing a single tuple.
authorKurt B. Kaiser <kbk@shore.net>
Thu, 5 Jul 2007 22:03:39 +0000 (22:03 +0000)
committerKurt B. Kaiser <kbk@shore.net>
Thu, 5 Jul 2007 22:03:39 +0000 (22:03 +0000)
Calls using METH_OLDARGS unpack this tuple; calls using METH_VARARG
don't.  Tcl's concatenation of args was affected; IDLE doesn't start.

Modify Tkapp_Call() to unpack single tuple arglists.

Bug 1733943
Ref http://mail.python.org/pipermail/python-checkins/2007-May/060454.html

Modules/_tkinter.c

index 1f94929cde356bfadf6aab5f794448bcef5d670e..22d930b9818405c1b1993431b11e3c939a80635f 100644 (file)
@@ -1285,6 +1285,12 @@ Tkapp_Call(PyObject *selfptr, PyObject *args)
        /* Could add TCL_EVAL_GLOBAL if wrapped by GlobalCall... */
        int flags = TCL_EVAL_DIRECT;
 
+       /* If args is a single tuple, replace with contents of tuple */
+       if (1 == PyTuple_Size(args)){
+               PyObject* item = PyTuple_GetItem(args, 0);
+               if (PyTuple_Check(item))
+                       args = item;
+       }
 #ifdef WITH_THREAD
        if (self->threaded && self->thread_id != Tcl_GetCurrentThread()) {
                /* We cannot call the command directly. Instead, we must