Skip to content
Snippets Groups Projects
Commit e3b7f1fa authored by Manuel Günther's avatar Manuel Günther
Browse files

Getting module imports correct

parent 3d1c75a7
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
......
......@@ -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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment