From 5a7a4f29fcba0a9b07f12f7f3d2f6b15b0c02ec4 Mon Sep 17 00:00:00 2001 From: johnslavik Date: Sun, 15 Feb 2026 22:39:43 +0100 Subject: [PATCH] Fix `__lazy_import__` crash --- Python/import.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Python/import.c b/Python/import.c index c20c55727d2f94..22e9ba36390e7b 100644 --- a/Python/import.c +++ b/Python/import.c @@ -4501,6 +4501,9 @@ _PyImport_LazyImportModuleLevelObject(PyThreadState *tstate, assert(!PyErr_Occurred()); modname = Py_NewRef(Py_None); } + if (fromlist == NULL) { + fromlist = Py_NewRef(Py_None); + } PyObject *args[] = {modname, name, fromlist}; PyObject *res = PyObject_Vectorcall(filter, args, 3, NULL);