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.
This commit is contained in:
Benjamin Peterson 2012-01-22 11:24:29 -05:00
parent cd8991255c
commit ce79852077
11 changed files with 153 additions and 164 deletions

View file

@ -265,9 +265,9 @@ PyComplex_ImagAsDouble(PyObject *op)
static PyObject *
try_complex_special_method(PyObject *op) {
PyObject *f;
static PyObject *complexstr;
_Py_IDENTIFIER(__complex__);
f = _PyObject_LookupSpecial(op, "__complex__", &complexstr);
f = _PyObject_LookupSpecial(op, &PyId___complex__);
if (f) {
PyObject *res = PyObject_CallFunctionObjArgs(f, NULL);
Py_DECREF(f);