diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-10-03 10:27:41 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-10-03 10:27:41 +0400 |
commit | a618708f48088d0975cb2b3e0a92b547579aea76 (patch) | |
tree | e95df8bbcba37922a36e9b4609e1f02aa09daeb1 /source/gameengine | |
parent | 365282e5c8c382a26f5111a8ae9921a989235e66 (diff) |
Blender works with python 2.6, our own import functions that replace pythons internal function needed updating for an extra in argument in 2.6.
if importing is not working blender should not crash (was crashing on exit)
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/Ketsji/KX_PythonInit.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 53b141a9bfe..cdf7ebd0943 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -1077,9 +1077,17 @@ PyObject *KXpy_import(PyObject *self, PyObject *args) PyObject *fromlist = NULL; PyObject *l, *m, *n; +#if (PY_VERSION_HEX >= 0x02060000) + int dummy_val; /* what does this do?*/ + + if (!PyArg_ParseTuple(args, "s|OOOi:m_import", + &name, &globals, &locals, &fromlist, &dummy_val)) + return NULL; +#else if (!PyArg_ParseTuple(args, "s|OOO:m_import", &name, &globals, &locals, &fromlist)) return NULL; +#endif /* check for builtin modules */ m = PyImport_AddModule("sys"); @@ -1492,6 +1500,7 @@ int saveGamePythonConfig( char **marshal_buffer) } Py_DECREF(gameLogic); } else { + PyErr_Clear(); printf("Error, GameLogic failed to import GameLogic.globalDict will be lost\n"); } return marshal_length; @@ -1523,6 +1532,7 @@ int loadGamePythonConfig(char *marshal_buffer, int marshal_length) printf("Error could not marshall string\n"); } } else { + PyErr_Clear(); printf("Error, GameLogic failed to import GameLogic.globalDict will be lost\n"); } } |