From 9e9f8192d9e535adf88d17af9b7ffe355549ecc4 Mon Sep 17 00:00:00 2001 From: Dino Viehland Date: Fri, 7 Nov 2025 08:23:49 -0800 Subject: [PATCH] Clear error before trying again --- Python/importdl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Python/importdl.c b/Python/importdl.c index 23a55c39677100..10a497fa1ba157 100644 --- a/Python/importdl.c +++ b/Python/importdl.c @@ -413,6 +413,8 @@ _PyImport_GetModuleExportHooks( if (exportfunc) { *modexport = (PyModExportFunction)exportfunc; return 2; + } else if (PyErr_Occurred()) { + PyErr_Clear(); } exportfunc = findfuncptr(