From 159a01082e734d75c61ef6cab72276e338ec887e Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Wed, 22 Apr 2009 23:52:46 -0700 Subject: [PATCH] Input from Mark Lodato on embedding --- Cython/Compiler/ModuleNode.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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(); -- 2.26.2