Skip to content

Commit

Permalink
Removed duplicated constants from c module
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuel Guenther committed May 20, 2015
1 parent 454f5b6 commit 6e00d9c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
7 changes: 1 addition & 6 deletions bob/measure/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1095,15 +1095,10 @@ static PyObject* create_module (void) {
if (!m) return 0;
auto m_ = make_safe(m); ///< protects against early returns

if (PyModule_AddStringConstant(m, "__version__", BOB_EXT_MODULE_VERSION) < 0)
return 0;

/* imports bob.blitz C-API + dependencies */
if (import_bob_blitz() < 0) return 0;

Py_INCREF(m);
return m;

return Py_BuildValue("O", m);
}

PyMODINIT_FUNC BOB_EXT_ENTRY_NAME (void) {
Expand Down
7 changes: 2 additions & 5 deletions bob/measure/version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,18 +158,15 @@ static PyObject* create_module (void) {
auto m_ = make_safe(m); ///< protects against early returns

/* register version numbers and constants */
if (PyModule_AddStringConstant(m, "module", BOB_EXT_MODULE_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) {
Expand Down

0 comments on commit 6e00d9c

Please sign in to comment.