From: Robert Bradshaw Date: Thu, 23 Apr 2009 06:52:46 +0000 (-0700) Subject: Input from Mark Lodato on embedding X-Git-Tag: 0.11.2.rc1~52^2~2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=159a01082e734d75c61ef6cab72276e338ec887e;p=cython.git Input from Mark Lodato on embedding --- diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index 4b20b83b..018fb19d 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -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();