summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_pickle.c8
-rw-r--r--Modules/arraymodule.c3
-rw-r--r--Modules/itertoolsmodule.c3
3 files changed, 6 insertions, 8 deletions
diff --git a/Modules/_pickle.c b/Modules/_pickle.c
index c4fe349..58cd09c 100644
--- a/Modules/_pickle.c
+++ b/Modules/_pickle.c
@@ -209,19 +209,15 @@ _Pickle_ClearState(PickleState *st)
static int
_Pickle_InitState(PickleState *st)
{
- PyObject *builtins;
PyObject *copyreg = NULL;
PyObject *compat_pickle = NULL;
PyObject *codecs = NULL;
PyObject *functools = NULL;
+ _Py_IDENTIFIER(getattr);
- builtins = PyEval_GetBuiltins();
- if (builtins == NULL)
- goto error;
- st->getattr = PyDict_GetItemString(builtins, "getattr");
+ st->getattr = _PyEval_GetBuiltinId(&PyId_getattr);
if (st->getattr == NULL)
goto error;
- Py_INCREF(st->getattr);
copyreg = PyImport_ImportModule("copyreg");
if (!copyreg)
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c
index aa7a4fb..1bfc4dd 100644
--- a/Modules/arraymodule.c
+++ b/Modules/arraymodule.c
@@ -2943,7 +2943,8 @@ static PyObject *
array_arrayiterator___reduce___impl(arrayiterobject *self)
/*[clinic end generated code: output=7898a52e8e66e016 input=a062ea1e9951417a]*/
{
- PyObject *func = _PyObject_GetBuiltin("iter");
+ _Py_IDENTIFIER(iter);
+ PyObject *func = _PyEval_GetBuiltinId(&PyId_iter);
if (self->ao == NULL) {
return Py_BuildValue("N(())", func);
}
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c
index 89c0280..581ae2c 100644
--- a/Modules/itertoolsmodule.c
+++ b/Modules/itertoolsmodule.c
@@ -368,8 +368,9 @@ _grouper_next(_grouperobject *igo)
static PyObject *
_grouper_reduce(_grouperobject *lz, PyObject *Py_UNUSED(ignored))
{
+ _Py_IDENTIFIER(iter);
if (((groupbyobject *)lz->parent)->currgrouper != lz) {
- return Py_BuildValue("N(())", _PyObject_GetBuiltin("iter"));
+ return Py_BuildValue("N(())", _PyEval_GetBuiltinId(&PyId_iter));
}
return Py_BuildValue("O(OO)", Py_TYPE(lz), lz->parent, lz->tgtkey);
}