diff options
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/Ketsji/KX_PythonInit.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index eead7a51885..ac49b49c130 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -1622,10 +1622,20 @@ PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecur Py_FrozenFlag=1; Py_Initialize(); + if(argv && first_time) { /* browser plugins dont currently set this */ #if (PY_VERSION_HEX < 0x03000000) - if(argv && first_time) /* browser plugins dont currently set this */ PySys_SetArgv(argc, argv); +#else + int i; + PyObject *py_argv= PyList_New(argc); + + for (i=0; i<argc; i++) + PyList_SET_ITEM(py_argv, i, PyUnicode_FromString(argv[i])); + + PySys_SetObject("argv", py_argv); + Py_DECREF(py_argv); #endif + } //importBlenderModules() setSandbox(level); |