From a6006fc11a2b4287b690b3f9736a3d015782efc6 Mon Sep 17 00:00:00 2001 From: mwganson Date: Thu, 17 Oct 2024 05:45:07 +0000 Subject: [PATCH] [Python Console] prevent crash on autocomplete if python module is invalid, fixes issue #17299 --- src/Gui/CallTips.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Gui/CallTips.cpp b/src/Gui/CallTips.cpp index 927004310b..b26fc5594e 100644 --- a/src/Gui/CallTips.cpp +++ b/src/Gui/CallTips.cpp @@ -204,7 +204,11 @@ QMap CallTipsList::extractTips(const QString& context) const return tips; try { + PyErr_Clear(); Py::Module module("__main__"); + if (module.ptr() == nullptr) { + return tips; + } Py::Dict dict = module.getDict(); // this is used to filter out input of the form "1."