mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
gh-106521: Remove _PyObject_LookupAttr() function (GH-106642)
This commit is contained in:
parent
e8ab0096a5
commit
be1b968dc1
45 changed files with 351 additions and 352 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue