diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-07-08 13:23:49 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-07-08 13:23:49 +0400 |
commit | a97b645a4455d332409a07a82e47182f72852360 (patch) | |
tree | f826b7a98b9c7786185dace536fe79dff4585f7e /source/gameengine/Ketsji/KX_PythonInit.cpp | |
parent | d896ed98fef159e2f67364dcceab7011791618e6 (diff) |
* workaround for PySys_SetArgv() in python3 needing wchar_t
* PyRNA - id_struct.keyframe_insert("path", index, frame)
Diffstat (limited to 'source/gameengine/Ketsji/KX_PythonInit.cpp')
-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); |