summaryrefslogtreecommitdiff
path: root/Objects/stringobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/stringobject.c')
-rw-r--r--Objects/stringobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/stringobject.c b/Objects/stringobject.c
index d78e2a3d15..6d933a10fb 100644
--- a/Objects/stringobject.c
+++ b/Objects/stringobject.c
@@ -3948,7 +3948,7 @@ static PyObject *
string_sizeof(PyStringObject *v)
{
Py_ssize_t res;
- res = PyStringObject_SIZE + v->ob_size * v->ob_type->tp_itemsize;
+ res = PyStringObject_SIZE + PyString_GET_SIZE(v) * Py_TYPE(v)->tp_itemsize;
return PyInt_FromSsize_t(res);
}