[Python Console] prevent crash on autocomplete if python module is invalid, fixes issue #17299

This commit is contained in:
mwganson
2024-10-17 05:45:07 +00:00
committed by Chris Hennes
parent a4bfafe7ad
commit 2736ab56af

View File

@@ -204,7 +204,11 @@ QMap<QString, CallTip> 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."