Mercurial > cpython-lru_cache-weakref
diff Modules/parsermodule.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 | 9faa9270457e |
| children | 7109f31300fb |
line wrap: on
line diff
--- a/Modules/parsermodule.c Mon Oct 10 03:21:36 2011 +0200 +++ b/Modules/parsermodule.c Mon Oct 10 18:11:30 2011 +0200 @@ -3241,10 +3241,13 @@ copyreg = PyImport_ImportModuleNoBlock("copyreg"); if (copyreg != NULL) { PyObject *func, *pickler; - - func = PyObject_GetAttrString(copyreg, "pickle"); - pickle_constructor = PyObject_GetAttrString(module, "sequence2st"); - pickler = PyObject_GetAttrString(module, "_pickler"); + _Py_identifier(pickle); + _Py_identifier(sequence2st); + _Py_identifier(_pickler); + + func = _PyObject_GetAttrId(copyreg, &PyId_pickle); + pickle_constructor = _PyObject_GetAttrId(module, &PyId_sequence2st); + pickler = _PyObject_GetAttrId(module, &PyId__pickler); Py_XINCREF(pickle_constructor); if ((func != NULL) && (pickle_constructor != NULL) && (pickler != NULL)) {
