aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/_warnings.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/_warnings.c')
-rw-r--r--Python/_warnings.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/_warnings.c b/Python/_warnings.c
index e0580f01d93..82e621243a0 100644
--- a/Python/_warnings.c
+++ b/Python/_warnings.c
@@ -223,7 +223,7 @@ get_warnings_attr(PyInterpreterState *interp, PyObject *attr, int try_import)
return NULL;
}
- (void)_PyObject_LookupAttr(warnings_module, attr, &obj);
+ (void)PyObject_GetOptionalAttr(warnings_module, attr, &obj);
Py_DECREF(warnings_module);
return obj;
}
@@ -1069,7 +1069,7 @@ get_source_line(PyInterpreterState *interp, PyObject *module_globals, int lineno
Py_INCREF(module_name);
/* Make sure the loader implements the optional get_source() method. */
- (void)_PyObject_LookupAttr(loader, &_Py_ID(get_source), &get_source);
+ (void)PyObject_GetOptionalAttr(loader, &_Py_ID(get_source), &get_source);
Py_DECREF(loader);
if (!get_source) {
Py_DECREF(module_name);