]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backport gvanrossum's checkin of revision 2.80:
authorMichael W. Hudson <mwh@python.net>
Tue, 19 Feb 2002 14:17:02 +0000 (14:17 +0000)
committerMichael W. Hudson <mwh@python.net>
Tue, 19 Feb 2002 14:17:02 +0000 (14:17 +0000)
Bugfix candidate.

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 */