From 1c7c0dd0a02680fb80215587aff0154470733fb2 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Wed, 31 Oct 2018 23:07:44 -0700 Subject: [PATCH] Booboo... --- tools/auto-tester/src/PythonInterface.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/auto-tester/src/PythonInterface.cpp b/tools/auto-tester/src/PythonInterface.cpp index 2866ca0b87..c5878939cc 100644 --- a/tools/auto-tester/src/PythonInterface.cpp +++ b/tools/auto-tester/src/PythonInterface.cpp @@ -14,6 +14,19 @@ #include PythonInterface::PythonInterface() { + if (QProcessEnvironment::systemEnvironment().contains("PYTHON_PATH")) { + QString _pythonPath = QProcessEnvironment::systemEnvironment().value("PYTHON_PATH"); + if (!QFile::exists(_pythonPath + "/" + _pythonExe)) { + QMessageBox::critical(0, _pythonExe, QString("Python executable not found in ") + _pythonPath); + exit(-1); + } + + _pythonCommand = _pythonPath + "/" + _pythonExe; + } else { + QMessageBox::critical(0, "PYTHON_PATH not defined", + "Please set PYTHON_PATH to directory containing the Python executable"); + exit(-1); + } } QString PythonInterface::getPythonCommand() {