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;