From 45ef64f4f9e7b48a0edd98a60748e1656ce5c122 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Tue, 16 Jan 2024 12:27:21 +0100 Subject: [PATCH] Python: fix venv check FilePath::contains only checks whether the passed string is inside the path, and not whether the path contains a folder or file with the passed string. Change-Id: I20a1a9a52a9f9a436433848ac2eccd38666274d7 Reviewed-by: Christian Stenger --- src/plugins/python/pythonutils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/python/pythonutils.cpp b/src/plugins/python/pythonutils.cpp index 71cbc5763d2..63d1f7a7c30 100644 --- a/src/plugins/python/pythonutils.cpp +++ b/src/plugins/python/pythonutils.cpp @@ -192,7 +192,7 @@ void createVenv(const FilePath &python, bool isVenvPython(const FilePath &python) { - return python.parentDir().parentDir().contains("pyvenv.cfg"); + return python.parentDir().parentDir().pathAppended("pyvenv.cfg").exists(); } bool venvIsUsable(const FilePath &python)