Skip to content

Commit 6131c29

Browse files
another fix for python > 3.7.
Signed-off-by: David Rebbe <drebbe@intrepidcs.com>
1 parent 1406631 commit 6131c29

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/methods.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3819,11 +3819,12 @@ PyObject* meth_uart_read(PyObject* self, PyObject* args)
38193819
return set_ics_exception(exception_runtime_error(), "icsneoUartRead() Failed");
38203820
}
38213821
Py_END_ALLOW_THREADS
3822-
PyObject* value = Py_BuildValue("y#", buffer, bytesActuallyRead);
3822+
PyObject* ba_result = PyByteArray_FromStringAndSize((const char*)buffer, bytesActuallyRead);
3823+
PyObject* value = Py_BuildValue("Y", ba_result);
38233824
free(buffer);
38243825
buffer = NULL;
3826+
Py_DECREF(ba_result);
38253827
return value;
3826-
38273828
}
38283829
catch (ice::Exception& ex)
38293830
{

0 commit comments

Comments
 (0)