diff --git a/bob/math/main.cpp b/bob/math/main.cpp index 7e271f4fe338bff888bbd247b1311bfeb0f69c0b..4f70e351c17edf0a8e537a44af1b5479eb92aecc 100644 --- a/bob/math/main.cpp +++ b/bob/math/main.cpp @@ -10,6 +10,7 @@ #endif #include <bob.blitz/capi.h> #include <bob.blitz/cleanup.h> +#include <bob.core/api.h> #include <bob.extension/documentation.h> @@ -525,11 +526,8 @@ static PyObject* create_module (void) { (PyObject *)&PyBobMathLpInteriorPointLongstep_Type) < 0) return 0; /* imports dependencies */ - if (import_bob_blitz() < 0) { - PyErr_Print(); - PyErr_Format(PyExc_ImportError, "cannot import `%s'", BOB_EXT_MODULE_NAME); - return 0; - } + if (import_bob_blitz() < 0) return 0; + if (import_bob_core_logging() < 0) return 0; return Py_BuildValue("O", m); } diff --git a/bob/math/version.cpp b/bob/math/version.cpp index ac0d00e2a0b81cffb638d3ccfc1bfd8d67dfd7bb..537bae6420d6ac38b9c52486c2cc2a6625638b1d 100644 --- a/bob/math/version.cpp +++ b/bob/math/version.cpp @@ -8,11 +8,8 @@ #include <bob.math/config.h> #define BOB_IMPORT_VERSION -#ifdef NO_IMPORT_ARRAY -#undef NO_IMPORT_ARRAY -#endif -#include <bob.blitz/capi.h> -#include <bob.core/api.h> +#include <bob.blitz/config.h> +#include <bob.core/config.h> static PyObject* build_version_dictionary() { @@ -20,7 +17,7 @@ static PyObject* build_version_dictionary() { if (!retval) return 0; auto retval_ = make_safe(retval); - if (!dict_set(retval, "Blitz++", BZ_VERSION)) return 0; + if (!dict_steal(retval, "Blitz++", blitz_version())) return 0; if (!dict_steal(retval, "Boost", boost_version())) return 0; if (!dict_steal(retval, "Compiler", compiler_version())) return 0; if (!dict_steal(retval, "Python", python_version())) return 0; @@ -68,9 +65,6 @@ static PyObject* create_module (void) { if (!externals) return 0; if (PyModule_AddObject(m, "externals", externals) < 0) return 0; - if (import_bob_blitz() < 0) return 0; - if (import_bob_core_logging() < 0) return 0; - return Py_BuildValue("O", m); }