diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2018-12-11 08:28:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-11 08:28:18 +0200 |
commit | bb86bf4c4eaa30b1f5192dab9f389ce0bb61114d (patch) | |
tree | b9dbe54e2c1380294f3e2396450132d5b205af0a /Modules/arraymodule.c | |
parent | bpo-35402: Update macOS installer to use Tcl 8.6.9 / Tk 8.6.9.1 (GH-11101) (diff) | |
download | cpython-bb86bf4c4eaa30b1f5192dab9f389ce0bb61114d.tar.gz cpython-bb86bf4c4eaa30b1f5192dab9f389ce0bb61114d.tar.bz2 cpython-bb86bf4c4eaa30b1f5192dab9f389ce0bb61114d.zip |
bpo-35444: Unify and optimize the helper for getting a builtin object. (GH-11047)
This speeds up pickling of some iterators.
This fixes also error handling in pickling methods when fail to
look up builtin "getattr".
Diffstat (limited to 'Modules/arraymodule.c')
-rw-r--r-- | Modules/arraymodule.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c index aa7a4fb23c6..1bfc4dd95bf 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); } |