mirror of
https://github.com/bulletphysics/bullet3.git
synced 2026-08-28 05:58:35 +00:00
PyUnicode_AsUTF8 breaks python 2.x compatibility
This commit is contained in:
@@ -137,12 +137,20 @@ static const char* pybullet_internalGetCStringFromSequence(PyObject* seq, int in
|
||||
if (PyList_Check(seq))
|
||||
{
|
||||
item = PyList_GET_ITEM(seq, index);
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
v = PyUnicode_AsUTF8(item);
|
||||
#else
|
||||
v = PyBytes_AsString(item);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
item = PyTuple_GET_ITEM(seq, index);
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
v = PyUnicode_AsUTF8(item);
|
||||
#else
|
||||
v = PyBytes_AsString(item);
|
||||
#endif
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user