aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/import.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/import.c')
-rw-r--r--Python/import.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/import.c b/Python/import.c
index 7ce89cdf9a9..3e52a4e4eb1 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -2878,7 +2878,7 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *globals,
}
else {
PyObject *path;
- if (_PyObject_LookupAttr(mod, &_Py_ID(__path__), &path) < 0) {
+ if (PyObject_GetOptionalAttr(mod, &_Py_ID(__path__), &path) < 0) {
goto error;
}
if (path) {