Commit 560f8c2e authored by Stefan Behnel's avatar Stefan Behnel

minimal implementation of module init procedure for embedding case, ignoring...

minimal implementation of module init procedure for embedding case, ignoring module attributes for now (which we don't know anyway, e.g. __file__ ?)
parent de5cc1b2
...@@ -32,6 +32,17 @@ static int __Pyx_main(int argc, wchar_t **argv) { ...@@ -32,6 +32,17 @@ static int __Pyx_main(int argc, wchar_t **argv) {
%(module_is_main)s = 1; %(module_is_main)s = 1;
#if PY_MAJOR_VERSION < 3 #if PY_MAJOR_VERSION < 3
init%(module_name)s(); init%(module_name)s();
#elif CYTHON_PEP489_MULTI_PHASE_INIT
{
PyObject *modname = PyUnicode_FromString("__main__");
if (modname) {
// FIXME: not currently calling create() here because we do not have a module spec!
// FIXME: not currently setting __file__, __path__, __spec__, ...
m = PyModule_NewObject(modname);
Py_DECREF(modname);
if (m) __pyx_pymod_exec_%(module_name)s(m);
}
}
#else #else
m = PyInit_%(module_name)s(); m = PyInit_%(module_name)s();
#endif #endif
......
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