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 /Python/sysmodule.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 'Python/sysmodule.c')
-rw-r--r-- | Python/sysmodule.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 0ac6edc..fea3f61 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -257,7 +257,7 @@ sys_audit_tstate(PyThreadState *ts, const char *event, PyThreadState_EnterTracing(ts); while ((hook = PyIter_Next(hooks)) != NULL) { PyObject *o; - int canTrace = _PyObject_LookupAttr(hook, &_Py_ID(__cantrace__), &o); + int canTrace = PyObject_GetOptionalAttr(hook, &_Py_ID(__cantrace__), &o); if (o) { canTrace = PyObject_IsTrue(o); Py_DECREF(o); @@ -657,7 +657,7 @@ sys_displayhook_unencodable(PyObject *outf, PyObject *o) if (encoded == NULL) goto error; - if (_PyObject_LookupAttr(outf, &_Py_ID(buffer), &buffer) < 0) { + if (PyObject_GetOptionalAttr(outf, &_Py_ID(buffer), &buffer) < 0) { Py_DECREF(encoded); goto error; } |