fix bus error on Raspberry Pi, unaligned float access when loading STL files

fix pybullet Python 3 issue (PyString_FromString -> PyBytes_FromString and PyInt_FromLong -> PyLong_FromLong)
This commit is contained in:
Erwin Coumans
2016-06-23 05:10:00 +00:00
parent df0b2a2e3a
commit f5ffb11bc5
2 changed files with 12 additions and 7 deletions

View File

@@ -9,6 +9,12 @@
#include <Python.h>
#endif
#if PY_MAJOR_VERSION >= 3
#define PyInt_FromLong PyLong_FromLong
#define PyString_FromString PyBytes_FromString
#endif
enum eCONNECT_METHOD
{
eCONNECT_GUI=1,
@@ -769,7 +775,6 @@ pybullet_getJointInfo(PyObject* self, PyObject* args)
// info.m_flags,
// info.m_jointDamping,
// info.m_jointFriction);
PyTuple_SetItem(pyListJointInfo, 0,
PyInt_FromLong(info.m_jointIndex));
PyTuple_SetItem(pyListJointInfo, 1,
@@ -786,7 +791,6 @@ pybullet_getJointInfo(PyObject* self, PyObject* args)
PyFloat_FromDouble(info.m_jointDamping));
PyTuple_SetItem(pyListJointInfo, 7,
PyFloat_FromDouble(info.m_jointFriction));
return pyListJointInfo;
}
}