Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r948 - trunk/SwigInterface


Chronological Thread 
  • From: abe@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r948 - trunk/SwigInterface
  • Date: Tue, 21 Feb 2006 23:04:36 -0700 (MST)

Author: abe
Date: Tue Feb 21 23:04:36 2006
New Revision: 948

Modified:
   trunk/SwigInterface/python.cc
Log:

Fixed code for passing command line args to python script.

Now segfaults when it attempts to run script, instead of generating a python 
error.

M    python.cc


Modified: trunk/SwigInterface/python.cc
==============================================================================
--- trunk/SwigInterface/python.cc       (original)
+++ trunk/SwigInterface/python.cc       Tue Feb 21 23:04:36 2006
@@ -109,6 +109,10 @@
         throw IllegalArgument("-function <name>", i, args);
       }
     }
+    else {
+      // Beginning of function arguments
+      break;
+    }
   }
 
   
/////////////////////////////////////////////////////////////////////////////
@@ -117,11 +121,7 @@
   PyObject *pArgs, *pValue;
 
   Py_Initialize();
-  if (Py_IsInitialized()) {
-    std::cerr << "python is initialize\n";
-  } else {
-    std::cerr << "python is not initialize\n";
-  }
+
   pName = PyString_FromString( file_name.c_str() );
   /* Error checking of pName left out */
 
@@ -154,6 +154,7 @@
       Py_DECREF(pArgs);
 
       if (pValue != NULL) {
+        std::cerr << "Function call successful" << std::endl;
         printf("Result of call: %ld\n", PyInt_AsLong(pValue));
         Py_DECREF(pValue);
       }




  • [MANTA] r948 - trunk/SwigInterface, abe, 02/21/2006

Archive powered by MHonArc 2.6.16.

Top of page