summaryrefslogtreecommitdiff
path: root/src/sim/main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/sim/main.cc')
-rw-r--r--src/sim/main.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sim/main.cc b/src/sim/main.cc
index 8bb0d7aaa..133141e57 100644
--- a/src/sim/main.cc
+++ b/src/sim/main.cc
@@ -55,6 +55,7 @@
#include "base/statistics.hh"
#include "base/str.hh"
#include "base/time.hh"
+#include "config/pythonhome.hh"
#include "cpu/base.hh"
#include "cpu/smt.hh"
#include "mem/mem_object.hh"
@@ -145,6 +146,11 @@ main(int argc, char **argv)
if (setenv("PYTHONPATH", pythonpath.c_str(), true) == -1)
fatal("setenv: %s\n", strerror(errno));
+ char *python_home = getenv("PYTHONHOME");
+ if (!python_home)
+ python_home = PYTHONHOME;
+ Py_SetPythonHome(python_home);
+
// initialize embedded Python interpreter
Py_Initialize();
PySys_SetArgv(argc, argv);