use PyImport_ExtendInittab for py module initialization rather then adding to sys.modules directly, no functional change.

This commit is contained in:
2010-10-29 22:59:39 +00:00
parent 719c941c58
commit ced06081b8
13 changed files with 41 additions and 47 deletions

View File

@@ -196,6 +196,22 @@ void BPY_set_context(bContext *C)
BPy_SetContext(C);
}
/* init-tab */
extern PyObject *BPyInit_noise(void);
extern PyObject *BPyInit_mathutils(void);
extern PyObject *BPyInit_bgl(void);
extern PyObject *BPyInit_blf(void);
extern PyObject *AUD_initPython(void);
static struct _inittab bpy_internal_modules[]= {
{"noise", BPyInit_noise},
{"mathutils", BPyInit_mathutils},
{"bgl", BPyInit_bgl},
{"blf", BPyInit_blf},
{"aud", AUD_initPython},
{NULL, NULL}
};
/* call BPY_set_context first */
void BPY_start_python( int argc, char **argv )
{
@@ -206,6 +222,9 @@ void BPY_start_python( int argc, char **argv )
utf8towchar(bprogname_wchar, bprogname);
Py_SetProgramName(bprogname_wchar);
/* builtin modules */
PyImport_ExtendInittab(bpy_internal_modules);
BPY_start_python_path(); /* allow to use our own included python */
Py_Initialize( );