Fix FTBFS with Python 3.13.

This solves issue #32.

Signed-off-by: François Andriot <albator78@libertysurf.fr>
pull/33/head
François Andriot 2 months ago committed by François Andriot
parent df4895c1e1
commit d0ab12dc39

@ -890,9 +890,16 @@ const char *PyTQt_tqt_encode(PyObject **s, TQApplication::Encoding encoding)
es = PyBytes_AS_STRING(obj);
Py_INCREF(obj);
}
else if (PyObject_AsCharBuffer(obj, &es, &sz) >= 0)
else
{
Py_INCREF(obj);
Py_buffer view;
if (PyObject_GetBuffer(obj, &view, PyBUF_SIMPLE) == 0) {
es = (const char*)view.buf;
sz = view.len;
PyBuffer_Release(&view);
Py_INCREF(obj);
}
}
if (es)

Loading…
Cancel
Save