We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a3c8210 commit 274d09bCopy full SHA for 274d09b
include/eigenpy/details.hpp
@@ -8,6 +8,7 @@
8
9
#include "eigenpy/fwd.hpp"
10
11
+#include <patchlevel.h> // For PY_MAJOR_VERSION
12
#include <numpy/arrayobject.h>
13
#include <iostream>
14
@@ -93,9 +94,11 @@ namespace eigenpy
93
94
NumpyType()
95
{
96
pyModule = bp::import("numpy");
97
+#if PY_MAJOR_VERSION >= 3
98
// TODO I don't know why this Py_INCREF is necessary.
99
// Without it, the destructor of NumpyType SEGV sometimes.
100
Py_INCREF(pyModule.ptr());
101
+#endif
102
103
NumpyMatrixObject = pyModule.attr("matrix");
104
NumpyMatrixType = reinterpret_cast<PyTypeObject*>(NumpyMatrixObject.ptr());
0 commit comments