Commit e7ce376d authored by Manuel Günther's avatar Manuel Günther
Browse files

Getting module imports correct

parent 47c4b39c
......@@ -263,11 +263,7 @@ static PyObject* create_module (void) {
auto m_ = make_safe(m);
/* 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;
return Py_BuildValue("O", m);
}
......
......@@ -18,6 +18,8 @@
* There will be a compiler warning, when these functions are not used, so use them!
***************************************/
#include <Python.h>
#include <boost/preprocessor/stringize.hpp>
/**
* bob.core c/c++ api version
......
......@@ -8,10 +8,14 @@
#define BOB_CORE_LOGGING_MODULE
#include <bob.core/api.h>
#ifdef NO_IMPORT_ARRAY
#undef NO_IMPORT_ARRAY
#endif
#include <bob.blitz/capi.h>
#include <bob.blitz/cleanup.h>
#include <boost/shared_array.hpp>
#include <boost/make_shared.hpp>
#include <bob.core/config.h>
#include <bob.blitz/cleanup.h>
#define PYTHON_LOGGING_DEBUG 0
......@@ -563,8 +567,10 @@ static PyObject* create_module (void) {
if (c_api_object) PyModule_AddObject(m, "_C_API", c_api_object);
return Py_BuildValue("O", m);
/* imports dependencies */
if (import_bob_blitz() < 0) return 0;
return Py_BuildValue("O", m);
}
PyMODINIT_FUNC BOB_EXT_ENTRY_NAME (void) {
......
......@@ -173,11 +173,7 @@ static PyObject* create_module (void) {
if (c_api_object) PyModule_AddObject(m, "_C_API", c_api_object);
/* 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;
return Py_BuildValue("O", m);
}
......
......@@ -11,7 +11,8 @@
#ifdef NO_IMPORT_ARRAY
#undef NO_IMPORT_ARRAY
#endif
#include <bob.blitz/capi.h>
#include <bob.blitz/config.h>
#include <bob.blitz/cleanup.h>
static PyObject* build_version_dictionary() {
......@@ -19,7 +20,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;
......@@ -66,9 +67,6 @@ static PyObject* create_module (void) {
if (!externals) return 0;
if (PyModule_AddObject(m, "externals", externals) < 0) return 0;
/* imports dependencies */
if (import_bob_blitz() < 0) return 0;
return Py_BuildValue("O", m);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment