python: fix cdata to work with Python 3.x.
This commit is contained in:
parent
1cad211547
commit
08d59537c3
|
@ -69,6 +69,17 @@ int sr_session_datafeed_python_callback_add(PyObject *cb)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PyObject *cdata(const void *data, unsigned long size)
|
||||||
|
{
|
||||||
|
#if PY_MAJOR_VERSION < 3
|
||||||
|
return PyString_FromStringAndSize(data, size);
|
||||||
|
#else
|
||||||
|
return PyBytes_FromStringAndSize(data, size);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
int sr_session_datafeed_python_callback_add(PyObject *cb);
|
int sr_session_datafeed_python_callback_add(PyObject *cb);
|
||||||
|
|
||||||
|
PyObject *cdata(const void *data, unsigned long size);
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
|
|
||||||
%include "cpointer.i"
|
%include "cpointer.i"
|
||||||
%include "carrays.i"
|
%include "carrays.i"
|
||||||
%include "cdata.i"
|
|
||||||
%include "stdint.i"
|
%include "stdint.i"
|
||||||
|
|
||||||
%{
|
%{
|
||||||
|
|
Loading…
Reference in New Issue