===Python API===

Response to bug #4398: print separate messages on start-up to show (a) the
built-in Python version and (b) whether a Python installation was found.
This commit is contained in:
Ken Hughes
2006-07-08 20:40:41 +00:00
parent cf266ea2af
commit 121f13fef7

View File

@@ -147,7 +147,7 @@ void BPY_start_python( int argc, char **argv )
* rest of our init msgs.
*/
// Py_GetVersion() returns a ptr to astatic string
printf( "Looking for installed Python version %.3s\n", Py_GetVersion() );
printf( "Compiled with Python version %.3s.\n", Py_GetVersion() );
//Initialize the TOP-LEVEL modules
PyImport_ExtendInittab(BPy_Inittab_Modules);
@@ -264,10 +264,11 @@ void init_syspath( int first_time )
python install found.
*/
printf("Checking for installed Python... "); /* appears after msg "Compiled with Python 2.x" */
mod = PyImport_ImportModule( "site" ); /* new ref */
if( mod ) {
printf("Got it!\n"); /* appears after msg Looking for Python... */
printf("got it!\n");
Py_DECREF( mod );
} else { /* import 'site' failed */
PyErr_Clear( );