Mercurial > cpython-lru_cache-weakref
diff Modules/arraymodule.c @ 72848:81380082d216
Use identifier API for PyObject_GetAttrString.
| author | Martin v. Löwis <martin@v.loewis.de> |
|---|---|
| date | Mon, 10 Oct 2011 18:11:30 +0200 |
| parents | 5e33219492bc |
| children | 7109f31300fb |
line wrap: on
line diff
--- a/Modules/arraymodule.c Mon Oct 10 03:21:36 2011 +0200 +++ b/Modules/arraymodule.c Mon Oct 10 18:11:30 2011 +0200 @@ -2003,14 +2003,16 @@ int mformat_code; static PyObject *array_reconstructor = NULL; long protocol; + _Py_identifier(_array_reconstructor); + _Py_identifier(__dict__); if (array_reconstructor == NULL) { PyObject *array_module = PyImport_ImportModule("array"); if (array_module == NULL) return NULL; - array_reconstructor = PyObject_GetAttrString( + array_reconstructor = _PyObject_GetAttrId( array_module, - "_array_reconstructor"); + &PyId__array_reconstructor); Py_DECREF(array_module); if (array_reconstructor == NULL) return NULL; @@ -2025,7 +2027,7 @@ if (protocol == -1 && PyErr_Occurred()) return NULL; - dict = PyObject_GetAttrString((PyObject *)array, "__dict__"); + dict = _PyObject_GetAttrId((PyObject *)array, &PyId___dict__); if (dict == NULL) { if (!PyErr_ExceptionMatches(PyExc_AttributeError)) return NULL;
