summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-05-12 14:36:19 (GMT)
committerGuido van Rossum <guido@python.org>1998-05-12 14:36:19 (GMT)
commit597ac20708c5a17805d1baaeac787b93b913f851 (patch)
tree62ed43f8edc24c6d9bce2fecbf326ffe33846200
parentb298a300dd8c93da79dfd1d9bf1123b1af6641de (diff)
downloadcpython-597ac20708c5a17805d1baaeac787b93b913f851.zip
cpython-597ac20708c5a17805d1baaeac787b93b913f851.tar.gz
cpython-597ac20708c5a17805d1baaeac787b93b913f851.tar.bz2
Trivial little change: timer tokens shouldn't have a Print() function,
they should have a Repr() function.
-rw-r--r--Modules/_tkinter.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index 7b4cf79..f80b118 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -1286,17 +1286,16 @@ Tktt_Dealloc(self)
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 @@ static PyTypeObject Tktt_Type =
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 */