From: Simon Marchi Date: Wed, 20 Nov 2019 20:29:42 +0000 (-0500) Subject: bt2: make Graph add listener methods return None X-Git-Tag: v2.0.0~57 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=9c58b68e5cc87d3b71c60dd11305567c3db8e3de bt2: make Graph add listener methods return None The methods add_ports_connected_listener and add_port_added_listener of bt2.Graph currently return a _ListenerHandle object. This is not useful today, since it's not possible to remove those listeners (unlike trace class and trace destruction listeners). Make them not return a handle for now. It will be possible to make them return a handle again if/when we add the possibility to remove those listeners. Change-Id: I5ea1c9d8793232c2f7077b5c2b82797438066d13 Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/2424 Tested-by: jenkins Reviewed-by: Philippe Proulx --- diff --git a/src/bindings/python/bt2/bt2/graph.py b/src/bindings/python/bt2/bt2/graph.py index a36c85d1..79be1ca8 100644 --- a/src/bindings/python/bt2/bt2/graph.py +++ b/src/bindings/python/bt2/bt2/graph.py @@ -166,8 +166,6 @@ class Graph(object._SharedObject): if listener_ids is None: raise bt2._Error('cannot add listener to graph object') - return utils._ListenerHandle(listener_ids, self) - def add_ports_connected_listener(self, listener): if not callable(listener): raise TypeError("'listener' parameter is not callable") @@ -181,8 +179,6 @@ class Graph(object._SharedObject): if listener_ids is None: raise bt2._Error('cannot add listener to graph object') - return utils._ListenerHandle(listener_ids, self) - def run_once(self): status = native_bt.graph_run_once(self._ptr) utils._handle_func_status(status, 'graph object could not run once')