Update of /cvsroot/mahogany/M/src/Python
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8237/src/Python

Modified Files:
        PythonHelp.cpp 
Log Message:
don't crash if Python is enabled but couldn't be initialized

Index: PythonHelp.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/Python/PythonHelp.cpp,v
retrieving revision 1.44
retrieving revision 1.45
diff -b -u -2 -r1.44 -r1.45
--- PythonHelp.cpp      16 Jan 2006 20:32:26 -0000      1.44
+++ PythonHelp.cpp      8 Apr 2006 00:34:37 -0000       1.45
@@ -88,5 +88,5 @@
                Profile *profile)
 {
-   // first check if Python is not disabled
+   // first check if Python is initialized
    if ( !IsPythonInitialized() )
       return def;
@@ -126,6 +126,6 @@
 FindPythonFunction(const char *func, PyObject **module, PyObject **function)
 {
-   // first check if Python is not disabled
-   if ( !READ_APPCONFIG(MP_USEPYTHON) )
+   // first check if Python is initialized
+   if ( !IsPythonInitialized() )
    {
       ERRORMESSAGE(( _("Python support is disabled, please enable it in "
@@ -316,12 +316,6 @@
 PythonRunScript(const char *filename)
 {
-   // first check if Python is not disabled
-   if ( !READ_APPCONFIG(MP_USEPYTHON) )
-   {
-      // normally we shouldn't even get here
-      FAIL_MSG( _T("Python is disabled, can't run script!") );
-
-      return false;
-   }
+   // first check if Python is initialized
+   CHECK( IsPythonInitialized(), false, _T("Can't run Python scripts!") );
 
    // the canonical Python API for what we want is PyRun_SimpleFile() but we



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Mahogany-cvsupdates mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to