Commit 159a0108 authored by Robert Bradshaw's avatar Robert Bradshaw

Input from Mark Lodato on embedding

parent 8868ff82
...@@ -2461,6 +2461,7 @@ impl = """ ...@@ -2461,6 +2461,7 @@ impl = """
int main(int argc, char** argv) { int main(int argc, char** argv) {
int r = 0; int r = 0;
PyObject* m = NULL; PyObject* m = NULL;
Py_SetProgramName(argv[0]);
Py_Initialize(); Py_Initialize();
PySys_SetArgv(argc, argv); PySys_SetArgv(argc, argv);
#if PY_MAJOR_VERSION < 3 #if PY_MAJOR_VERSION < 3
...@@ -2471,7 +2472,7 @@ int main(int argc, char** argv) { ...@@ -2471,7 +2472,7 @@ int main(int argc, char** argv) {
if (PyErr_Occurred() != NULL) { if (PyErr_Occurred() != NULL) {
r = 1; r = 1;
PyErr_Print(); /* This exits with the right code if SystemExit. */ PyErr_Print(); /* This exits with the right code if SystemExit. */
if (Py_FlushLine()); PyErr_Clear(); if (Py_FlushLine()) PyErr_Clear();
} }
Py_XDECREF(m); Py_XDECREF(m);
Py_Finalize(); Py_Finalize();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment