diff --git a/src/libs/qtcreatorcdbext/CMakeLists.txt b/src/libs/qtcreatorcdbext/CMakeLists.txt index b6171d183dd..45d55474aad 100644 --- a/src/libs/qtcreatorcdbext/CMakeLists.txt +++ b/src/libs/qtcreatorcdbext/CMakeLists.txt @@ -45,9 +45,9 @@ add_qtc_library(qtcreatorcdbext qtc_library_enabled(_library_enabled qtcreatorcdbext) if (_library_enabled) - find_package(PythonLibs 3.5) + find_package(PythonLibs 3.8) if (NOT ${PYTHONLIBS_FOUND}) - message(WARNING "PythonLibs (at least version 3.5) not found. qtcreatorcdbext will be built without Python support.") + message(WARNING "PythonLibs (at least version 3.8) not found. qtcreatorcdbext will be built without Python support.") return() endif() diff --git a/src/libs/qtcreatorcdbext/extensioncontext.cpp b/src/libs/qtcreatorcdbext/extensioncontext.cpp index c6ae69fac7e..4842289c670 100644 --- a/src/libs/qtcreatorcdbext/extensioncontext.cpp +++ b/src/libs/qtcreatorcdbext/extensioncontext.cpp @@ -162,7 +162,14 @@ HRESULT ExtensionContext::initialize(PULONG Version, PULONG Flags) #ifdef WITH_PYTHON initCdbextPythonModule(); - Py_Initialize(); + PyStatus status; + PyConfig config; + PyConfig_InitIsolatedConfig(&config); + status = Py_InitializeFromConfig(&config); + PyConfig_Clear(&config); + if (PyStatus_Exception(status)) { + Py_ExitStatusException(status); + } PyRun_SimpleString("import cdbext"); PyRun_SimpleString("import sys"); #endif diff --git a/src/libs/qtcreatorcdbext/qtcreatorcdbext.pro b/src/libs/qtcreatorcdbext/qtcreatorcdbext.pro index 98961887b94..f9f30f925f9 100644 --- a/src/libs/qtcreatorcdbext/qtcreatorcdbext.pro +++ b/src/libs/qtcreatorcdbext/qtcreatorcdbext.pro @@ -114,7 +114,7 @@ isEmpty(PYTHON_INSTALL_DIR):PYTHON_INSTALL_DIR=$$(PYTHON_INSTALL_DIR) CONFIG(debug, debug|release): deploy_python.recurse = Debug QMAKE_EXTRA_TARGETS += deploy_python } else { - message("Set PYTHON_INSTALL_DIR pointing to Python 3.5 or greater to enable the python dumpers for cdb.") + message("Set PYTHON_INSTALL_DIR pointing to Python 3.8 or greater to enable the python dumpers for cdb.") } target.path = $$QTC_PREFIX/lib/$${DIRNAME} # TODO this should go to INSTALL_LIBRARY_PATH/$${DIRNAME} diff --git a/src/libs/qtcreatorcdbext/qtcreatorcdbext.qbs b/src/libs/qtcreatorcdbext/qtcreatorcdbext.qbs index 3f446e2916f..fac2f7a25b7 100644 --- a/src/libs/qtcreatorcdbext/qtcreatorcdbext.qbs +++ b/src/libs/qtcreatorcdbext/qtcreatorcdbext.qbs @@ -50,10 +50,11 @@ QtcLibrary { + output + "'"); return; } - if (Utilities.versionCompare(versionNumberString, "3.5") < 0) { + var pythonMinVersion = "3.8"; + if (Utilities.versionCompare(versionNumberString, pythonMinVersion) < 0) { printWarning("The python installation at '" + pythonDir - + "' has version " + versionNumberString + ", but 3.5 or higher " - + "is required."); + + "' has version " + versionNumberString + ", but " + + pythonMinVersion + " or higher is required."); return; } found = true; diff --git a/src/libs/qtcreatorcdbext/qtcreatorcdbextension.cpp b/src/libs/qtcreatorcdbext/qtcreatorcdbextension.cpp index f4dcde9736c..4895fb6c2e5 100644 --- a/src/libs/qtcreatorcdbext/qtcreatorcdbextension.cpp +++ b/src/libs/qtcreatorcdbext/qtcreatorcdbextension.cpp @@ -654,7 +654,7 @@ extern "C" HRESULT CALLBACK script(CIDebugClient *client, PCSTR argsIn) ExtensionContext::instance().report('N', token, 0, "script", "Python is not supported in this CDB extension.\n" "You need to define PYTHON_INSTALL_DIR in your creator build environment " - "pointing to a Python 3.5 installation."); + "pointing to a Python 3.8 installation."); #endif return S_OK; }