From: <geo...@us...> - 2011-06-20 01:37:38
|
Revision: 4003 http://freeorion.svn.sourceforge.net/freeorion/revision/?rev=4003&view=rev Author: geoffthemedio Date: 2011-06-20 01:37:32 +0000 (Mon, 20 Jun 2011) Log Message: ----------- Moved some logging in PythonAI initialization to before exported module initialization so that if the init fails, there's still some logger output about the initial Python interpreter setup having worked. Modified Paths: -------------- trunk/FreeOrion/AI/PythonAI.cpp Modified: trunk/FreeOrion/AI/PythonAI.cpp =================================================================== --- trunk/FreeOrion/AI/PythonAI.cpp 2011-06-20 01:36:16 UTC (rev 4002) +++ trunk/FreeOrion/AI/PythonAI.cpp 2011-06-20 01:37:32 UTC (rev 4003) @@ -186,6 +186,12 @@ #endif Py_Initialize(); // initializes Python interpreter, allowing Python functions to be called from C++ + Logger().debugStream() << "Python version: " << Py_GetVersion(); + Logger().debugStream() << "Python prefix: " << Py_GetPrefix(); + Logger().debugStream() << "Python module search path: " << Py_GetPath(); + + Logger().debugStream() << "Initializing C++ interfaces for Python"; + initfreeOrionLogger(); // allows the "freeOrionLogger" C++ module to be imported within Python code initfreeOrionAIInterface(); // allows the "freeOrionAIInterface" C++ module to be imported within Python code } catch (...) { @@ -193,10 +199,6 @@ return; } - Logger().debugStream() << "Python version: " << Py_GetVersion(); - Logger().debugStream() << "Python prefix: " << Py_GetPrefix(); - Logger().debugStream() << "Python module search path: " << Py_GetPath(); - try { // get main namespace, needed to run other interpreted code object main_module = import("__main__"); |