ext: Stop using the uninitialized pythonMain in sst.
Import the __main__ module when it's first used. Change-Id: If800bd575398970faa8cb88072becd3d2b4218c0 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/54307 Maintainer: Gabe Black <gabe.black@gmail.com> Reviewed-by: Jason Lowe-Power <power.jg@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -355,7 +355,8 @@ gem5Component::doSimLoop(gem5::EventQueue* eventq)
|
||||
int
|
||||
gem5Component::execPythonCommands(const std::vector<std::string>& commands)
|
||||
{
|
||||
PyObject *dict = PyModule_GetDict(pythonMain);
|
||||
static PyObject *dict =
|
||||
py::module_::import("__main__").attr("__dict__").ptr();
|
||||
|
||||
PyObject *result;
|
||||
|
||||
|
||||
@@ -104,7 +104,6 @@ class gem5Component: public SST::Component
|
||||
|
||||
// stuff needed for gem5 sim
|
||||
public:
|
||||
PyObject *pythonMain;
|
||||
int execPythonCommands(const std::vector<std::string>& commands);
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user