Use identifier API for PyObject_GetAttrString.

This commit is contained in:
Martin v. Löwis 2011-10-10 18:11:30 +02:00
parent 794d567b17
commit 1ee1b6fe0d
28 changed files with 499 additions and 357 deletions

View file

@ -3077,12 +3077,14 @@ tzinfo_reduce(PyObject *self)
{
PyObject *args, *state, *tmp;
PyObject *getinitargs, *getstate;
_Py_identifier(__getinitargs__);
_Py_identifier(__getstate__);
tmp = PyTuple_New(0);
if (tmp == NULL)
return NULL;
getinitargs = PyObject_GetAttrString(self, "__getinitargs__");
getinitargs = _PyObject_GetAttrId(self, &PyId___getinitargs__);
if (getinitargs != NULL) {
args = PyObject_CallObject(getinitargs, tmp);
Py_DECREF(getinitargs);
@ -3097,7 +3099,7 @@ tzinfo_reduce(PyObject *self)
Py_INCREF(args);
}
getstate = PyObject_GetAttrString(self, "__getstate__");
getstate = _PyObject_GetAttrId(self, &PyId___getstate__);
if (getstate != NULL) {
state = PyObject_CallObject(getstate, tmp);
Py_DECREF(getstate);