aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 0ac6edc5a16..fea3f61ee01 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;
}