From a8129f6b41df2f9916df63bc8477823317c38c44 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 6 Aug 2010 12:46:22 +0000 Subject: [PATCH] fix for fake python bge.* module, this is really nasty temp py code! (not a good example) --- source/gameengine/Ketsji/KX_PythonInit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 2e490c24217..3e63aa61d82 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -1990,7 +1990,7 @@ void setupGamePython(KX_KetsjiEngine* ketsjiengine, KX_Scene* startscene, Main * initVideoTexture(); /* could be done a lot more nicely, but for now a quick way to get bge.* working */ - PyRun_SimpleString("__import__('sys').modules['bge']=[mod for mod in (type(__builtins__)('bge'), ) if mod.__dict__.update({'logic':__import__('GameLogic'), 'render':__import__('Rasterizer'), 'events':__import__('GameKeys'), 'constraints':__import__('PhysicsConstraints'), 'types':__import__('GameTypes')}) is None][0]"); + PyRun_SimpleString("sys = __import__('sys');mod = sys.modules['bge'] = type(sys)('bge');mod.__dict__.update({'logic':__import__('GameLogic'), 'render':__import__('Rasterizer'), 'events':__import__('GameKeys'), 'constraints':__import__('PhysicsConstraints'), 'types':__import__('GameTypes')})"); } static struct PyModuleDef Rasterizer_module_def = {