diff --git a/src/runner/pythonRunner.pro b/src/runner/pythonRunner.pro index e6e7d71..4da9d64 100644 --- a/src/runner/pythonRunner.pro +++ b/src/runner/pythonRunner.pro @@ -13,14 +13,13 @@ CONFIG += warn_on DEFINES += PYTHONRUNNER_LIBRARY # suppress a few warnings caused by boost vs vc++ paranoia -DEFINES += _SCL_SECURE_NO_WARNINGS -DHAVE_ROUND +DEFINES += _SCL_SECURE_NO_WARNINGS !include(../LocalPaths.pri) { message("paths to required libraries need to be set up in LocalPaths.pri") } - SOURCES += pythonrunner.cpp \ gilock.cpp \ error.cpp \ diff --git a/src/runner/pythonrunner.cpp b/src/runner/pythonrunner.cpp index 2a3da87..0c328f4 100644 --- a/src/runner/pythonrunner.cpp +++ b/src/runner/pythonrunner.cpp @@ -841,7 +841,7 @@ PythonRunner::PythonRunner(const MOBase::IOrganizer *moInfo) m_PythonHome = new char[MAX_PATH + 1]; } -static char* argv0 = "ModOrganizer.exe"; +static const char *argv0 = "ModOrganizer.exe"; bool PythonRunner::initPython(const QString &pythonPath) @@ -855,7 +855,10 @@ bool PythonRunner::initPython(const QString &pythonPath) Py_SetPythonHome(m_PythonHome); } - Py_SetProgramName(argv0); + char argBuffer[MAX_PATH]; + strcpy(argBuffer, argv0); + + Py_SetProgramName(argBuffer); PyImport_AppendInittab("mobase", &initmobase); Py_OptimizeFlag = 2; Py_NoSiteFlag = 1; @@ -865,7 +868,7 @@ bool PythonRunner::initPython(const QString &pythonPath) return false; } - PySys_SetArgv(0, &argv0); + PySys_SetArgv(0, (char**)&argBuffer); bpy::object mainModule = bpy::import("__main__"); bpy::object mainNamespace = mainModule.attr("__dict__");