X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=src%2Fbindings%2Fpython%2Fbt2%2Fbt2%2Ftrace.py;fp=src%2Fbindings%2Fpython%2Fbt2%2Fbt2%2Ftrace.py;h=1c56b034c400789beade4d3aff1f1fa55bcb2678;hp=a582f8fd97876f2029632ac80a041d827db48dfc;hb=f5567ea88d172767b34373bc6e402da8bfd85ef8;hpb=419d8c49bd978a59b8a0619d83cb6ba26b18f970 diff --git a/src/bindings/python/bt2/bt2/trace.py b/src/bindings/python/bt2/bt2/trace.py index a582f8fd..1c56b034 100644 --- a/src/bindings/python/bt2/bt2/trace.py +++ b/src/bindings/python/bt2/bt2/trace.py @@ -63,7 +63,7 @@ class _TraceEnvironment(_TraceEnvironmentConst, collections.abc.MutableMapping): elif isinstance(value, int): set_env_entry_fn = native_bt.trace_set_environment_entry_integer else: - raise TypeError('expected str or int, got {}'.format(type(value))) + raise TypeError("expected str or int, got {}".format(type(value))) status = set_env_entry_fn(self._trace._ptr, key, value) utils._handle_func_status(status, "cannot set trace object's environment entry") @@ -144,7 +144,7 @@ class _TraceConst(object._SharedObject, collections.abc.Mapping): return self._trace_env_pycls(self) def add_destruction_listener(self, listener): - '''Add a listener to be called when the trace is destroyed.''' + """Add a listener to be called when the trace is destroyed.""" if not callable(listener): raise TypeError("'listener' parameter is not callable") @@ -157,7 +157,7 @@ class _TraceConst(object._SharedObject, collections.abc.Mapping): status, listener_id = fn(self._ptr, listener_from_native) utils._handle_func_status( - status, 'cannot add destruction listener to trace object' + status, "cannot add destruction listener to trace object" ) handle._set_listener_id(listener_id) @@ -169,11 +169,11 @@ class _TraceConst(object._SharedObject, collections.abc.Mapping): if listener_handle._addr != self.addr: raise ValueError( - 'This trace destruction listener does not match the trace object.' + "This trace destruction listener does not match the trace object." ) if listener_handle._listener_id is None: - raise ValueError('This trace destruction listener was already removed.') + raise ValueError("This trace destruction listener was already removed.") status = native_bt.trace_remove_destruction_listener( self._ptr, listener_handle._listener_id @@ -236,7 +236,7 @@ class _Trace(_TraceConst): ) if stream_ptr is None: - raise bt2._MemoryError('cannot create stream object') + raise bt2._MemoryError("cannot create stream object") stream = bt2_stream._Stream._create_from_ptr(stream_ptr)