X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbindings%2Fpython%2Fbt2%2Fbt2%2Ftrace.py;fp=src%2Fbindings%2Fpython%2Fbt2%2Fbt2%2Ftrace.py;h=86bd90d05ae1d58844e9654a2f6009fe3eb0d3b1;hb=ee2cad25d5c65cd781169c897a53310cee9948fe;hp=5ddcbad29719123404c7ffc8d09c3ce878c77b54;hpb=5ae9f1bf3332a2dff16e6e811b982f0b5602dc47;p=babeltrace.git diff --git a/src/bindings/python/bt2/bt2/trace.py b/src/bindings/python/bt2/bt2/trace.py index 5ddcbad2..86bd90d0 100644 --- a/src/bindings/python/bt2/bt2/trace.py +++ b/src/bindings/python/bt2/bt2/trace.py @@ -185,8 +185,9 @@ class _Trace(object._SharedObject, collections.abc.Mapping): _trace_destruction_listener_from_native, listener ) - listener_id = fn(self._ptr, listener_from_native) - if listener_id is None: - utils._raise_bt2_error('cannot add destruction listener to trace object') + status, listener_id = fn(self._ptr, listener_from_native) + utils._handle_func_status( + status, 'cannot add destruction listener to trace object' + ) return bt2._ListenerHandle(listener_id, self)