]> granicus.if.org Git - python/commitdiff
Bugfix candidate.
authorGuido van Rossum <guido@python.org>
Fri, 1 Feb 2002 15:34:10 +0000 (15:34 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 1 Feb 2002 15:34:10 +0000 (15:34 +0000)
Fix SF bug #511603: Error calling str on subclass of int

Explicitly fill in tp_str with the same pointer as tp_repr.

Objects/intobject.c

index dfb03a9383d81e1af3acb891ec2cf08fd0ce1748..6c8bdbeb2abf030595ff6c60846407f698353f88 100644 (file)
@@ -893,7 +893,7 @@ PyTypeObject PyInt_Type = {
        0,                                      /* tp_as_mapping */
        (hashfunc)int_hash,                     /* tp_hash */
         0,                                     /* tp_call */
-        0,                                     /* tp_str */
+        (reprfunc)int_repr,                    /* tp_str */
        PyObject_GenericGetAttr,                /* tp_getattro */
        0,                                      /* tp_setattro */
        0,                                      /* tp_as_buffer */