diff options
author | Pauli Virtanen <pav@iki.fi> | 2009-12-06 12:07:20 +0000 |
---|---|---|
committer | Pauli Virtanen <pav@iki.fi> | 2009-12-06 12:07:20 +0000 |
commit | e05a07582c6eb99a434776c055d1c609c0744ca4 (patch) | |
tree | e512d926cab38f5ba64a21a89d961376fdc2398e /numpy/linalg | |
parent | 026e0d2910ac89220ee7554debbf5fdaec5e621f (diff) | |
download | numpy-e05a07582c6eb99a434776c055d1c609c0744ca4.tar.gz |
3K: linalg: module init for lapack_lite
Diffstat (limited to 'numpy/linalg')
-rw-r--r-- | numpy/linalg/lapack_litemodule.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/numpy/linalg/lapack_litemodule.c b/numpy/linalg/lapack_litemodule.c index 816624a7b..53d9f01d5 100644 --- a/numpy/linalg/lapack_litemodule.c +++ b/numpy/linalg/lapack_litemodule.c @@ -820,17 +820,46 @@ static struct PyMethodDef lapack_lite_module_methods[] = { static char lapack_lite_module_documentation[] = ""; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "lapack_lite", + NULL, + -1, + lapack_lite_module_methods, + NULL, + NULL, + NULL, + NULL +}; +#endif + +/* Initialization function for the module */ +#if PY_MAJOR_VERSION >= 3 +#define RETVAL m +PyObject *PyInit_lapack_lite(void) +#else +#define RETVAL PyMODINIT_FUNC initlapack_lite(void) +#endif { PyObject *m,*d; +#if PY_MAJOR_VERSION >= 3 + m = PyModule_Create(&moduledef); +#else m = Py_InitModule4("lapack_lite", lapack_lite_module_methods, lapack_lite_module_documentation, (PyObject*)NULL,PYTHON_API_VERSION); +#endif + if (m == NULL) { + return RETVAL; + } import_array(); d = PyModule_GetDict(m); LapackError = PyErr_NewException("lapack_lite.LapackError", NULL, NULL); PyDict_SetItemString(d, "LapackError", LapackError); - return; + return RETVAL; } |