Commit 8868ff82 authored by Robert Bradshaw's avatar Robert Bradshaw

more complete embedded mode (trac 291)

parent 611591bf
...@@ -2459,16 +2459,22 @@ static __Pyx_RefnannyAPIStruct *__Pyx_Refnanny = NULL; ...@@ -2459,16 +2459,22 @@ static __Pyx_RefnannyAPIStruct *__Pyx_Refnanny = NULL;
main_method = UtilityCode( main_method = UtilityCode(
impl = """ impl = """
int main(int argc, char** argv) { int main(int argc, char** argv) {
int r; int r = 0;
PyObject* m = NULL;
Py_Initialize(); Py_Initialize();
PySys_SetArgv(argc, argv); PySys_SetArgv(argc, argv);
#if PY_MAJOR_VERSION < 3 #if PY_MAJOR_VERSION < 3
init%(module_name)s(); init%(module_name)s();
#else #else
PyInit_%(module_name)s(name); m = PyInit_%(module_name)s(name);
#endif #endif
r = PyErr_Occurred() != NULL; if (PyErr_Occurred() != NULL) {
r = 1;
PyErr_Print(); /* This exits with the right code if SystemExit. */
if (Py_FlushLine()); PyErr_Clear();
}
Py_XDECREF(m);
Py_Finalize(); Py_Finalize();
return r; return r;
} }
""") """)
\ No newline at end of file
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