diff options
Diffstat (limited to 'src/plugins/python/pythonutils.cpp')
| -rw-r--r-- | src/plugins/python/pythonutils.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/plugins/python/pythonutils.cpp b/src/plugins/python/pythonutils.cpp index b2648fc7306..3cec49a2cd5 100644 --- a/src/plugins/python/pythonutils.cpp +++ b/src/plugins/python/pythonutils.cpp @@ -45,12 +45,10 @@ FilePath detectPython(const FilePath &documentPath) FilePaths dirs = Environment::systemEnvironment().path(); if (project && project->mimeType() == Constants::C_PY_PROJECT_MIME_TYPE) { - if (const Target *target = project->activeTarget()) { - if (auto bc = qobject_cast<PythonBuildConfiguration *>(target->activeBuildConfiguration())) - return bc->python(); - if (const std::optional<Interpreter> python = PythonKitAspect::python(target->kit())) - return python->command; - } + if (auto bc = qobject_cast<PythonBuildConfiguration *>(project->activeBuildConfiguration())) + return bc->python(); + if (const std::optional<Interpreter> python = PythonKitAspect::python(project->activeKit())) + return python->command; } const FilePath userDefined = userDefinedPythonsForDocument().value(documentPath); |
