Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2008-10-03 10:27:41 +0400
committerCampbell Barton <ideasman42@gmail.com>2008-10-03 10:27:41 +0400
commita618708f48088d0975cb2b3e0a92b547579aea76 (patch)
treee95df8bbcba37922a36e9b4609e1f02aa09daeb1 /source/gameengine
parent365282e5c8c382a26f5111a8ae9921a989235e66 (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.cpp10
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");
}
}