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 <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2024-01-16 12:27:21 +01:00
parent 443ce8e164
commit 45ef64f4f9

View File

@@ -192,7 +192,7 @@ void createVenv(const FilePath &python,
bool isVenvPython(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) bool venvIsUsable(const FilePath &python)