mirror of
https://github.com/ModOrganizer2/modorganizer-plugin_python.git
synced 2026-07-27 14:03:33 -07:00
- fixes after merge
This commit is contained in:
@@ -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 \
|
||||
|
||||
@@ -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__");
|
||||
|
||||
Reference in New Issue
Block a user