Input from Mark Lodato on embedding
authorRobert Bradshaw <robertwb@math.washington.edu>
Thu, 23 Apr 2009 06:52:46 +0000 (23:52 -0700)
committerRobert Bradshaw <robertwb@math.washington.edu>
Thu, 23 Apr 2009 06:52:46 +0000 (23:52 -0700)
Cython/Compiler/ModuleNode.py

index 4b20b83b2224f083084457bffc185cbe193ed8f3..018fb19dbaeb54c9aa394c932b2ea43d89d9b710 100644 (file)
@@ -2461,6 +2461,7 @@ impl = """
 int main(int argc, char** argv) {
     int r = 0;
     PyObject* m = NULL;
+    Py_SetProgramName(argv[0]);
     Py_Initialize();
     PySys_SetArgv(argc, argv);
 #if PY_MAJOR_VERSION < 3
@@ -2471,7 +2472,7 @@ int main(int argc, char** argv) {
     if (PyErr_Occurred() != NULL) {
         r = 1;
         PyErr_Print(); /* This exits with the right code if SystemExit. */
-        if (Py_FlushLine()); PyErr_Clear();
+        if (Py_FlushLine()) PyErr_Clear();
     }
     Py_XDECREF(m);
     Py_Finalize();