From 5d977114b3f2316274102ed110416549d47d13ff Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Mon, 21 Oct 2024 15:54:02 -0400 Subject: [PATCH] bt2: rename `_MessageIteratorConfiguration.can_seek_forward()` This method's name suggests that it's public and can be called by the user, but that's not the case, since it is overwritten by the write-only property just below. Example: File "/home/smarchi/build/babeltrace/src/bindings/python/bt2/build/build_lib/bt2/message_iterator.py", line 142, in _bt_init_from_native self.__init__(config, self_output_port) File "/home/smarchi/src/babeltrace/test.py", line 11, in __init__ config.can_seek_forward(False) ^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: property 'can_seek_forward' of '_MessageIteratorConfiguration' object has no getter Rename it to something that's more obviously not intended for the user. Change-Id: Ibef9cd8297569e2d4daea01ede00f3f0735abd90 Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/13387 Reviewed-by: Philippe Proulx --- src/bindings/python/bt2/bt2/message_iterator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bindings/python/bt2/bt2/message_iterator.py b/src/bindings/python/bt2/bt2/message_iterator.py index 8703e90b..162d6171 100644 --- a/src/bindings/python/bt2/bt2/message_iterator.py +++ b/src/bindings/python/bt2/bt2/message_iterator.py @@ -103,13 +103,13 @@ class _MessageIteratorConfiguration: def __init__(self, ptr): self._ptr = ptr - def can_seek_forward(self, value): + def _set_can_seek_forward(self, value): bt2_utils._check_bool(value) native_bt.self_message_iterator_configuration_set_can_seek_forward( self._ptr, value ) - can_seek_forward = property(fset=can_seek_forward) + can_seek_forward = property(fset=_set_can_seek_forward) # This is extended by the user to implement component classes in Python. It -- 2.34.1