diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2023-07-12 05:57:10 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-12 05:57:10 (GMT) |
| commit | be1b968dc1e63c3c68e161ddc5a05eb064833440 (patch) | |
| tree | 8689ba9f656854b83bf24b82de4fc471437a51ab /Objects/genobject.c | |
| parent | e8ab0096a583184fe24dfbc39eff70d270c8e6f4 (diff) | |
| download | cpython-be1b968dc1e63c3c68e161ddc5a05eb064833440.zip cpython-be1b968dc1e63c3c68e161ddc5a05eb064833440.tar.gz cpython-be1b968dc1e63c3c68e161ddc5a05eb064833440.tar.bz2 | |
gh-106521: Remove _PyObject_LookupAttr() function (GH-106642)
Diffstat (limited to 'Objects/genobject.c')
| -rw-r--r-- | Objects/genobject.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/genobject.c b/Objects/genobject.c index 6f0f02c..103e8b8 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -317,7 +317,7 @@ gen_close_iter(PyObject *yf) } else { PyObject *meth; - if (_PyObject_LookupAttr(yf, &_Py_ID(close), &meth) < 0) { + if (PyObject_GetOptionalAttr(yf, &_Py_ID(close), &meth) < 0) { PyErr_WriteUnraisable(yf); } if (meth) { @@ -492,7 +492,7 @@ _gen_throw(PyGenObject *gen, int close_on_genexit, } else { /* `yf` is an iterator or a coroutine-like object. */ PyObject *meth; - if (_PyObject_LookupAttr(yf, &_Py_ID(throw), &meth) < 0) { + if (PyObject_GetOptionalAttr(yf, &_Py_ID(throw), &meth) < 0) { Py_DECREF(yf); return NULL; } |
