* workaround for PySys_SetArgv() in python3 needing wchar_t

* PyRNA - id_struct.keyframe_insert("path", index, frame)
This commit is contained in:
2009-07-08 09:23:49 +00:00
parent d896ed98fe
commit a97b645a44
3 changed files with 79 additions and 10 deletions

View File

@@ -187,7 +187,21 @@ void BPY_start_python( int argc, char **argv )
Py_Initialize( );
//PySys_SetArgv( argc_copy, argv_copy );
#if (PY_VERSION_HEX < 0x03000000)
PySys_SetArgv( argc, argv);
#else
/* sigh, why do python guys not have a char** version anymore? :( */
{
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
/* Initialize thread support (also acquires lock) */
PyEval_InitThreads();