X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=src%2Fbindings%2Fpython%2Fbt2%2Fbt2%2Fnative_bt_component_class.i.h;h=58c6c7740f8fd72ce476c7dda96896f894c93e4d;hp=6774ec6f522f7d8a9230cb555a7162246fa6ed2a;hb=f2fb1b3297ca0bc13b53189a063b63944be7fae9;hpb=0a6d7302f774fbd35d7439889734acd418e8ef14 diff --git a/src/bindings/python/bt2/bt2/native_bt_component_class.i.h b/src/bindings/python/bt2/bt2/native_bt_component_class.i.h index 6774ec6f..58c6c774 100644 --- a/src/bindings/python/bt2/bt2/native_bt_component_class.i.h +++ b/src/bindings/python/bt2/bt2/native_bt_component_class.i.h @@ -538,13 +538,13 @@ void component_class_sink_finalize(bt_self_component_sink *self_component_sink) } static -bt_bool component_class_can_seek_beginning( - bt_self_message_iterator *self_message_iterator) +bt_component_class_message_iterator_can_seek_beginning_method_status +component_class_can_seek_beginning( + bt_self_message_iterator *self_message_iterator, bt_bool *can_seek) { PyObject *py_iter; PyObject *py_result = NULL; - bt_bool can_seek_beginning = false; - + bt_component_class_message_iterator_can_seek_beginning_method_status status; py_iter = bt_self_message_iterator_get_data(self_message_iterator); BT_ASSERT(py_iter); @@ -553,19 +553,16 @@ bt_bool component_class_can_seek_beginning( BT_ASSERT(!py_result || PyBool_Check(py_result)); if (py_result) { - can_seek_beginning = PyObject_IsTrue(py_result); + *can_seek = PyObject_IsTrue(py_result); + status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_CAN_SEEK_BEGINNING_METHOD_STATUS_OK; } else { - /* - * Once can_seek_beginning can report errors, convert the - * exception to a status. For now, log and return false; - */ - loge_exception_message_iterator(self_message_iterator); - PyErr_Clear(); + status = py_exc_to_status_message_iterator(self_message_iterator); + BT_ASSERT(status != __BT_FUNC_STATUS_OK); } Py_XDECREF(py_result); - return can_seek_beginning; + return status; } static