From e4d692a689a682a2b7476a9d5d4f115b81377b2b Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 22 Jun 2022 14:15:35 +0200 Subject: [PATCH] Python: only add python files as targets Change-Id: I21f0ca6035aed6306d6cbe55a6c6df0838e49f45 Reviewed-by: Christian Stenger --- src/plugins/python/pythonproject.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/python/pythonproject.cpp b/src/plugins/python/pythonproject.cpp index 0ce064a55f2..e80a6097961 100644 --- a/src/plugins/python/pythonproject.cpp +++ b/src/plugins/python/pythonproject.cpp @@ -254,7 +254,8 @@ void PythonBuildSystem::triggerParsing() const FileType fileType = getFileType(filePath); newRoot->addNestedNode(std::make_unique(filePath, displayName, fileType)); - if (fileType == FileType::Source) { + const MimeType mt = mimeTypeForFile(filePath, MimeMatchMode::MatchExtension); + if (mt.matchesName(Constants::C_PY_MIMETYPE) || mt.matchesName(Constants::C_PY3_MIMETYPE)) { BuildTargetInfo bti; bti.displayName = displayName; bti.buildKey = f;