diff options
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r-- | Objects/unicodeobject.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 9dead63..b0b525a 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -8350,20 +8350,8 @@ PyDoc_STRVAR(p_format__doc__, static PyObject * unicode__sizeof__(PyUnicodeObject *v) { - PyObject *res = NULL, *defsize = NULL; - - res = PyLong_FromSsize_t(sizeof(PyUnicodeObject) + - sizeof(Py_UNICODE) * (v->length + 1)); - if (v->defenc) { - defsize = PyObject_CallMethod(v->defenc, "__sizeof__", NULL); - if (defsize == NULL) { - Py_DECREF(res); - return NULL; - } - res = PyNumber_Add(res, defsize); - Py_DECREF(defsize); - } - return res; + return PyLong_FromSsize_t(sizeof(PyUnicodeObject) + + sizeof(Py_UNICODE) * (v->length + 1)); } PyDoc_STRVAR(sizeof__doc__, |