Skip to content

Commit 597ac20

Browse files
committed
Trivial little change: timer tokens shouldn't have a Print() function,
they should have a Repr() function.
1 parent b298a30 commit 597ac20

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

Modules/_tkinter.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,17 +1286,16 @@ Tktt_Dealloc(self)
12861286
PyMem_DEL(self);
12871287
}
12881288

1289-
static int
1290-
Tktt_Print(self, fp, flags)
1289+
static PyObject *
1290+
Tktt_Repr(self)
12911291
PyObject *self;
1292-
FILE *fp;
1293-
int flags;
12941292
{
12951293
TkttObject *v = (TkttObject *)self;
1294+
char buf[100];
12961295

1297-
fprintf(fp, "<tktimertoken at 0x%lx%s>", (long)v,
1296+
sprintf(buf, "<tktimertoken at 0x%lx%s>", (long)v,
12981297
v->func == NULL ? ", handler deleted" : "");
1299-
return 0;
1298+
return PyString_FromString(buf);
13001299
}
13011300

13021301
static PyObject *
@@ -1315,11 +1314,11 @@ static PyTypeObject Tktt_Type =
13151314
sizeof(TkttObject), /*tp_basicsize */
13161315
0, /*tp_itemsize */
13171316
Tktt_Dealloc, /*tp_dealloc */
1318-
Tktt_Print, /*tp_print */
1317+
0, /*tp_print */
13191318
Tktt_GetAttr, /*tp_getattr */
13201319
0, /*tp_setattr */
13211320
0, /*tp_compare */
1322-
0, /*tp_repr */
1321+
Tktt_Repr, /*tp_repr */
13231322
0, /*tp_as_number */
13241323
0, /*tp_as_sequence */
13251324
0, /*tp_as_mapping */

0 commit comments

Comments
 (0)