Commit 2549e3c3 authored by Guilhem Saurel's avatar Guilhem Saurel

[Python 3] PyCObject → PyCapsule

parent 3c6363cd
......@@ -42,7 +42,7 @@ OPTION (INSTALL_PYTHON_INTERFACE_ONLY "Install *ONLY* the python bindings" OFF)
IF(BUILD_PYTHON_INTERFACE)
FINDPYTHON()
ADD_REQUIRED_DEPENDENCY("dynamic-graph-python >= 3.0.0")
ADD_REQUIRED_DEPENDENCY("dynamic-graph-python >= 3.4.0")
SET(BOOST_COMPONENTS ${BOOST_COMPONENTS} python)
INCLUDE_DIRECTORIES(SYSTEM ${PYTHON_INCLUDE_PATH})
ADD_REQUIRED_DEPENDENCY("eigenpy")
......
......@@ -18,12 +18,12 @@ PyObject* setPinocchioModel(PyObject* /* self */, PyObject* args) {
pinocchio::Model* pointer2 = NULL;
if (!PyArg_ParseTuple(args, "OO", &object, &pyPinocchioObject)) return NULL;
if (!PyCObject_Check(object)) {
PyErr_SetString(PyExc_TypeError, "function takes a PyCObject as argument");
if (!PyCapsule_CheckExact(object)) {
PyErr_SetString(PyExc_TypeError, "function takes a PyCapsule as argument");
return NULL;
}
pointer1 = PyCObject_AsVoidPtr(object);
pointer1 = PyCapsule_GetPointer(object, "dynamic_graph.Entity");
DynamicPinocchio* dyn_entity = (DynamicPinocchio*)pointer1;
try {
......@@ -51,12 +51,12 @@ PyObject* setPinocchioData(PyObject* /* self */, PyObject* args) {
pinocchio::Data* pointer2 = NULL;
if (!PyArg_ParseTuple(args, "OO", &object, &pyPinocchioObject)) return NULL;
if (!PyCObject_Check(object)) {
PyErr_SetString(PyExc_TypeError, "function takes a PyCObject as argument");
if (!PyCapsule_CheckExact(object)) {
PyErr_SetString(PyExc_TypeError, "function takes a PyCapsule as argument");
return NULL;
}
pointer1 = PyCObject_AsVoidPtr(object);
pointer1 = PyCapsule_GetPointer(object, "dynamic_graph.Entity");
DynamicPinocchio* dyn_entity = (DynamicPinocchio*)pointer1;
try {
......
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