diff options
author | Benjamin Peterson <benjamin@python.org> | 2012-01-22 16:24:29 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2012-01-22 16:24:29 (GMT) |
commit | ce798520778e9cb41adfdc4f0a3cb5085a0b11be (patch) | |
tree | 915ea477cc6dfaa170d851f0c54f72b07c544874 /Python/sysmodule.c | |
parent | cd8991255c963858cc74f32d718e1d54987b26a0 (diff) | |
download | cpython-ce798520778e9cb41adfdc4f0a3cb5085a0b11be.zip cpython-ce798520778e9cb41adfdc4f0a3cb5085a0b11be.tar.gz cpython-ce798520778e9cb41adfdc4f0a3cb5085a0b11be.tar.bz2 |
use the static identifier api for looking up special methods
I had to move the static identifier code from unicodeobject.h to object.h in
order for this to work.
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r-- | Python/sysmodule.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c index ab0008e..d1517d3 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -814,10 +814,11 @@ static PyObject * sys_getsizeof(PyObject *self, PyObject *args, PyObject *kwds) { PyObject *res = NULL; - static PyObject *str__sizeof__ = NULL, *gc_head_size = NULL; + static PyObject *gc_head_size = NULL; static char *kwlist[] = {"object", "default", 0}; PyObject *o, *dflt = NULL; PyObject *method; + _Py_IDENTIFIER(__sizeof__); if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O:getsizeof", kwlist, &o, &dflt)) @@ -834,8 +835,7 @@ sys_getsizeof(PyObject *self, PyObject *args, PyObject *kwds) if (PyType_Ready(Py_TYPE(o)) < 0) return NULL; - method = _PyObject_LookupSpecial(o, "__sizeof__", - &str__sizeof__); + method = _PyObject_LookupSpecial(o, &PyId___sizeof__); if (method == NULL) { if (!PyErr_Occurred()) PyErr_Format(PyExc_TypeError, |