diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-10-30 02:59:39 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-10-30 02:59:39 +0400 |
commit | ced06081b8ef2c9cefd0ed61461c54d5393ca23d (patch) | |
tree | cf3b5fd656c58bce003bc9958d3f49621f47dc2a /source/blender/python/generic/mathutils.c | |
parent | 719c941c58f8b4acaced83c7521a6746fdd0841f (diff) |
use PyImport_ExtendInittab for py module initialization rather then adding to sys.modules directly, no functional change.
Diffstat (limited to 'source/blender/python/generic/mathutils.c')
-rw-r--r-- | source/blender/python/generic/mathutils.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/source/blender/python/generic/mathutils.c b/source/blender/python/generic/mathutils.c index f6b291622e3..4f54ee9e90e 100644 --- a/source/blender/python/generic/mathutils.c +++ b/source/blender/python/generic/mathutils.c @@ -245,12 +245,10 @@ static struct PyModuleDef M_Mathutils_module_def = { 0, /* m_free */ }; -PyObject *Mathutils_Init(void) +PyMODINIT_FUNC BPyInit_mathutils(void) { PyObject *submodule; - - - + if( PyType_Ready( &vector_Type ) < 0 ) return NULL; if( PyType_Ready( &matrix_Type ) < 0 ) @@ -263,7 +261,6 @@ PyObject *Mathutils_Init(void) return NULL; submodule = PyModule_Create(&M_Mathutils_module_def); - PyDict_SetItemString(PyImport_GetModuleDict(), M_Mathutils_module_def.m_name, submodule); /* each type has its own new() function */ PyModule_AddObject( submodule, "Vector", (PyObject *)&vector_Type ); @@ -273,9 +270,9 @@ PyObject *Mathutils_Init(void) PyModule_AddObject( submodule, "Color", (PyObject *)&color_Type ); /* submodule */ - PyModule_AddObject( submodule, "geometry", Geometry_Init()); + PyModule_AddObject( submodule, "geometry", BPyInit_mathutils_geometry()); mathutils_matrix_vector_cb_index= Mathutils_RegisterCallback(&mathutils_matrix_vector_cb); - return (submodule); + return submodule; } |