Mercurial > cpython-lru_cache-weakref
diff Modules/_tkinter.c @ 8312:d67be13da3cc legacy-trunk
Trivial little change: timer tokens shouldn't have a Print() function,
they should have a Repr() function.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Tue, 12 May 1998 14:36:19 +0000 |
| parents | 482e4ba33c08 |
| children | e42b94275652 |
line wrap: on
line diff
--- a/Modules/_tkinter.c Tue May 12 13:21:31 1998 +0000 +++ b/Modules/_tkinter.c Tue May 12 14:36:19 1998 +0000 @@ -1286,17 +1286,16 @@ PyMem_DEL(self); } -static int -Tktt_Print(self, fp, flags) +static PyObject * +Tktt_Repr(self) PyObject *self; - FILE *fp; - int flags; { TkttObject *v = (TkttObject *)self; + char buf[100]; - fprintf(fp, "<tktimertoken at 0x%lx%s>", (long)v, + sprintf(buf, "<tktimertoken at 0x%lx%s>", (long)v, v->func == NULL ? ", handler deleted" : ""); - return 0; + return PyString_FromString(buf); } static PyObject * @@ -1315,11 +1314,11 @@ sizeof(TkttObject), /*tp_basicsize */ 0, /*tp_itemsize */ Tktt_Dealloc, /*tp_dealloc */ - Tktt_Print, /*tp_print */ + 0, /*tp_print */ Tktt_GetAttr, /*tp_getattr */ 0, /*tp_setattr */ 0, /*tp_compare */ - 0, /*tp_repr */ + Tktt_Repr, /*tp_repr */ 0, /*tp_as_number */ 0, /*tp_as_sequence */ 0, /*tp_as_mapping */
