bt2: make can_seek_beginning a method instead of a property
[babeltrace.git] / src / bindings / python / bt2 / bt2 / message_iterator.py
index da9ca7474a2735daaf58c1619dd5473be3ee7400..284a7d94f88d943d8490b5ec21ba791c4edc0456 100644 (file)
@@ -56,9 +56,12 @@ class _GenericMessageIterator(object._SharedObject, _MessageIterator):
 
         return bt2_message._create_from_ptr(msg_ptr)
 
-    @property
     def can_seek_beginning(self):
-        res = self._can_seek_beginning(self._ptr)
+        status, res = self._can_seek_beginning(self._ptr)
+        utils._handle_func_status(
+            status,
+            'cannot check whether or not message iterator can seek its beginning',
+        )
         return res != 0
 
     def seek_beginning(self):
@@ -162,16 +165,15 @@ class _UserMessageIterator(_MessageIterator):
         msg._get_ref(msg._ptr)
         return int(msg._ptr)
 
-    @property
     def _bt_can_seek_beginning_from_native(self):
         # Here, we mimic the behavior of the C API:
         #
-        # - If the iterator has a _user_can_seek_beginning attribute,
+        # - If the iterator has a _user_can_seek_beginning method,
         #   read it and use that result.
         # - Otherwise, the presence or absence of a `_user_seek_beginning`
         #   method indicates whether the iterator can seek beginning.
         if hasattr(self, '_user_can_seek_beginning'):
-            can_seek_beginning = self._user_can_seek_beginning
+            can_seek_beginning = self._user_can_seek_beginning()
             utils._check_bool(can_seek_beginning)
             return can_seek_beginning
         else:
This page took 0.026438 seconds and 4 git commands to generate.