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

Removed duplicated constants from c module

parent ad046389
......@@ -3,8 +3,6 @@
# Andre Anjos <andre.anjos@idiap.ch>
# Fri 20 Sep 14:45:01 2013
import pkg_resources
from ._library import array, as_blitz
from . import version
from .version import module as __version__
......
......@@ -79,12 +79,6 @@ static PyObject* create_module (void) {
if (!m) return 0;
auto m_ = make_safe(m); ///< protects against early returns
/* register version numbers and constants */
if (PyModule_AddIntConstant(m, "__api_version__", BOB_BLITZ_API_VERSION) < 0)
return 0;
if (PyModule_AddStringConstant(m, "__version__", BOB_EXT_MODULE_VERSION) < 0)
return 0;
/* register the type object to python */
if (!init_BlitzArray(m)) return NULL;
......@@ -158,7 +152,6 @@ static PyObject* create_module (void) {
import_array1(0);
return Py_BuildValue("O", m);
}
PyMODINIT_FUNC BOB_EXT_ENTRY_NAME (void) {
......
......@@ -132,19 +132,15 @@ static PyObject* create_module (void) {
auto m_ = make_safe(m); ///< protects against early returns
/* register version numbers and constants */
if (PyModule_AddIntConstant(m, "api", BOB_BLITZ_API_VERSION) < 0)
return 0;
if (PyModule_AddStringConstant(m, "module", BOB_EXT_MODULE_VERSION) < 0)
return 0;
if (PyModule_AddIntConstant(m, "api", BOB_BLITZ_API_VERSION) < 0) return 0;
if (PyModule_AddStringConstant(m, "module", BOB_EXT_MODULE_VERSION) < 0) return 0;
PyObject* externals = build_version_dictionary();
if (!externals) return 0;
if (PyModule_AddObject(m, "externals", externals) < 0) return 0;
if (import_bob_blitz() < 0) return 0;
Py_INCREF(m);
return m;
return Py_BuildValue("O", m);
}
PyMODINIT_FUNC BOB_EXT_ENTRY_NAME (void) {
......
Supports Markdown
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