summaryrefslogtreecommitdiff
path: root/Objects/stringobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/stringobject.c')
-rw-r--r--Objects/stringobject.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/Objects/stringobject.c b/Objects/stringobject.c
index cb781ed645..bf5056e586 100644
--- a/Objects/stringobject.c
+++ b/Objects/stringobject.c
@@ -401,6 +401,13 @@ string_repr(register PyStringObject *op)
}
}
+static PyObject *
+string_str(PyObject *s)
+{
+ Py_INCREF(s);
+ return s;
+}
+
static int
string_length(PyStringObject *a)
{
@@ -2374,7 +2381,7 @@ PyTypeObject PyString_Type = {
0, /*tp_as_mapping*/
(hashfunc)string_hash, /*tp_hash*/
0, /*tp_call*/
- 0, /*tp_str*/
+ (reprfunc)string_str, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&string_as_buffer, /*tp_as_buffer*/