bug in createcommand

Guido.van.Rossum@cwi.nl
Wed, 08 Jun 1994 13:45:58 +0200

Here's a patch to Steen's tkintermodule.c which fixes Steve Miale's
problem. There were a few mistakes in the refcnt handling (I know, I
know, reference count are a nightmare...)

*** tkintermodule.c.bak Wed Jun 8 12:56:27 1994
--- tkintermodule.c Wed Jun 8 13:38:55 1994
***************
*** 599,601 ****
/* Args is: (cmdName, func) */
- Py_INCREF (args);
if (!PyTuple_Check (args)
--- 599,600 ----
***************
*** 614,615 ****
--- 613,615 ----

+ Py_INCREF (self);
PyTuple_SetItem (data, 0, self);
***************
*** 619,620 ****
--- 619,621 ----
Py_DECREF (PyMethod_Self (v));
+ Py_INCREF (v);
PyTuple_SetItem (data, 1, v);

--Guido van Rossum, CWI, Amsterdam <Guido.van.Rossum@cwi.nl>
URL: <http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>