diff options
Diffstat (limited to 'Modules/parsermodule.c')
-rw-r--r-- | Modules/parsermodule.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Modules/parsermodule.c b/Modules/parsermodule.c index f1679d72d0..3f03cee973 100644 --- a/Modules/parsermodule.c +++ b/Modules/parsermodule.c @@ -3241,10 +3241,13 @@ PyInit_parser(void) copyreg = PyImport_ImportModuleNoBlock("copyreg"); if (copyreg != NULL) { PyObject *func, *pickler; + _Py_identifier(pickle); + _Py_identifier(sequence2st); + _Py_identifier(_pickler); - func = PyObject_GetAttrString(copyreg, "pickle"); - pickle_constructor = PyObject_GetAttrString(module, "sequence2st"); - pickler = PyObject_GetAttrString(module, "_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)) { |