From ce798520778e9cb41adfdc4f0a3cb5085a0b11be Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Sun, 22 Jan 2012 11:24:29 -0500 Subject: 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. --- Objects/enumobject.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Objects/enumobject.c') diff --git a/Objects/enumobject.c b/Objects/enumobject.c index 00a33463cd..23b3808496 100644 --- a/Objects/enumobject.c +++ b/Objects/enumobject.c @@ -224,8 +224,8 @@ reversed_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { Py_ssize_t n; PyObject *seq, *reversed_meth; - static PyObject *reversed_cache = NULL; reversedobject *ro; + _Py_IDENTIFIER(__reversed__); if (type == &PyReversed_Type && !_PyArg_NoKeywords("reversed()", kwds)) return NULL; @@ -233,7 +233,7 @@ reversed_new(PyTypeObject *type, PyObject *args, PyObject *kwds) if (!PyArg_UnpackTuple(args, "reversed", 1, 1, &seq) ) return NULL; - reversed_meth = _PyObject_LookupSpecial(seq, "__reversed__", &reversed_cache); + reversed_meth = _PyObject_LookupSpecial(seq, &PyId___reversed__); if (reversed_meth != NULL) { PyObject *res = PyObject_CallFunctionObjArgs(reversed_meth, NULL); Py_DECREF(reversed_meth); -- cgit v1.2.1