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

more complete embedded mode (trac 291)

parent 611591bf
......@@ -2459,15 +2459,21 @@ static __Pyx_RefnannyAPIStruct *__Pyx_Refnanny = NULL;
main_method = UtilityCode(
impl = """
int main(int argc, char** argv) {
int r;
int r = 0;
PyObject* m = NULL;
Py_Initialize();
PySys_SetArgv(argc, argv);
#if PY_MAJOR_VERSION < 3
init%(module_name)s();
#else
PyInit_%(module_name)s(name);
m = PyInit_%(module_name)s(name);
#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();
return r;
}
......
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