Skip to content

Commit

Permalink
Fix Issue #707
Browse files Browse the repository at this point in the history
  • Loading branch information
thelfer committed Feb 3, 2025
1 parent 816026c commit 0c65cc4
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions bindings/python/tfel/InitNumpy.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,14 @@
* project under specific licensing conditions.
*/

#include <numpy/ndarrayobject.h>
#include <boost/python/numpy.hpp>
#include "TFEL/Numpy/InitNumpy.hxx"

#if PY_MAJOR_VERSION == 2
static void wrapInitializeNumPy() { import_array(); }
#else
static void* wrapInitializeNumPy() {
import_array();
return nullptr;
}
#endif

namespace tfel::numpy {

void initializeNumPy() {
Py_Initialize();
boost::python::numpy::initialize();
::wrapInitializeNumPy();
Py_Initialize();
boost::python::numpy::initialize();
} // end of initializeNumPy

} // end of namespace tfel::numpy

0 comments on commit 0c65cc4

Please sign in to comment.