From 0a205e0153be49774ea297ead783c728db86dc0b Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Wed, 15 Mar 2023 15:45:28 -0400 Subject: [PATCH] Bump black to version 23 Bump to the latest available black version. Change-Id: I62360ab9137ab2a5eb7fcc4dbbed913bfacee2e1 Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/9650 Reviewed-by: Philippe Proulx --- dev-requirements.txt | 2 +- src/bindings/python/bt2/bt2/component.py | 1 - src/bindings/python/bt2/bt2/field.py | 1 - src/bindings/python/bt2/bt2/integer_range_set.py | 1 - src/bindings/python/bt2/bt2/object.py | 1 - src/bindings/python/bt2/bt2/trace_class.py | 1 - tests/bindings/python/bt2/test_event_class.py | 1 - tests/bindings/python/bt2/utils.py | 1 - tests/data/plugins/src.ctf.lttng-live/lttng_live_server.py | 1 - 9 files changed, 1 insertion(+), 9 deletions(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 4331ffd0..f955fb6e 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,4 +1,4 @@ -black ~= 22.0 +black ~= 23.9.1 flake8 >= 3.8 # Required for black 22.0, it's broken with click >= 8.1 click < 8.1 diff --git a/src/bindings/python/bt2/bt2/component.py b/src/bindings/python/bt2/bt2/component.py index 7669a60d..1bb6763e 100644 --- a/src/bindings/python/bt2/bt2/component.py +++ b/src/bindings/python/bt2/bt2/component.py @@ -122,7 +122,6 @@ class _PortIterator(collections.abc.Iterator): class _ComponentPorts(collections.abc.Mapping): - # component_ptr is a bt_component_source *, bt_component_filter * or # bt_component_sink *. Its type must match the type expected by the # functions passed as arguments. diff --git a/src/bindings/python/bt2/bt2/field.py b/src/bindings/python/bt2/bt2/field.py index 40ce52c5..06c8385e 100644 --- a/src/bindings/python/bt2/bt2/field.py +++ b/src/bindings/python/bt2/bt2/field.py @@ -13,7 +13,6 @@ import math def _create_field_from_ptr_template( object_map, ptr, owner_ptr, owner_get_ref, owner_put_ref ): - field_class_ptr = native_bt.field_borrow_class_const(ptr) typeid = native_bt.field_class_get_type(field_class_ptr) field = object_map[typeid]._create_from_ptr_and_get_ref( diff --git a/src/bindings/python/bt2/bt2/integer_range_set.py b/src/bindings/python/bt2/bt2/integer_range_set.py index 68031314..44f2f380 100644 --- a/src/bindings/python/bt2/bt2/integer_range_set.py +++ b/src/bindings/python/bt2/bt2/integer_range_set.py @@ -91,7 +91,6 @@ class _IntegerRangeSetConst(object._SharedObject, collections.abc.Set): yield self._range_pycls(lower, upper) def __eq__(self, other): - if not isinstance(other, _IntegerRangeSetConst): return False diff --git a/src/bindings/python/bt2/bt2/object.py b/src/bindings/python/bt2/bt2/object.py index c1a23fdf..dcff667f 100644 --- a/src/bindings/python/bt2/bt2/object.py +++ b/src/bindings/python/bt2/bt2/object.py @@ -45,7 +45,6 @@ class _BaseObject: class _UniqueObject(_BaseObject): - # Create a _UniqueObject. # # - ptr: SWIG Object, pointer to the unique object. diff --git a/src/bindings/python/bt2/bt2/trace_class.py b/src/bindings/python/bt2/bt2/trace_class.py index 7fa8fa45..c89e9d21 100644 --- a/src/bindings/python/bt2/bt2/trace_class.py +++ b/src/bindings/python/bt2/bt2/trace_class.py @@ -87,7 +87,6 @@ class _TraceClassConst(object._SharedObject, collections.abc.Mapping): # Add a listener to be called when the trace class is destroyed. def add_destruction_listener(self, listener): - if not callable(listener): raise TypeError("'listener' parameter is not callable") diff --git a/tests/bindings/python/bt2/test_event_class.py b/tests/bindings/python/bt2/test_event_class.py index ae6f0981..0e97c09e 100644 --- a/tests/bindings/python/bt2/test_event_class.py +++ b/tests/bindings/python/bt2/test_event_class.py @@ -22,7 +22,6 @@ def _create_const_event_class(tc, stream_class): class MyIter(bt2._UserMessageIterator): def __init__(self, config, self_port_output): - trace = tc() stream = trace.create_stream(stream_class) self._msgs = [ diff --git a/tests/bindings/python/bt2/utils.py b/tests/bindings/python/bt2/utils.py index 410bb78c..c59fd8d5 100644 --- a/tests/bindings/python/bt2/utils.py +++ b/tests/bindings/python/bt2/utils.py @@ -53,7 +53,6 @@ def _get_all_message_types(with_packet=True): class MyIter(bt2._UserMessageIterator): def __init__(self, config, self_output_port): - nonlocal _msgs self._at = 0 self._msgs = [ diff --git a/tests/data/plugins/src.ctf.lttng-live/lttng_live_server.py b/tests/data/plugins/src.ctf.lttng-live/lttng_live_server.py index 8ef7e5fd..4e4a9b6d 100644 --- a/tests/data/plugins/src.ctf.lttng-live/lttng_live_server.py +++ b/tests/data/plugins/src.ctf.lttng-live/lttng_live_server.py @@ -901,7 +901,6 @@ def _split_metadata_sections(metadata_file_path, raw_config_sections): # If the next section begins at the current line, create a # section with the metadata we gathered so far. if curr_line_number >= next_section_line_number: - # Flushing the metadata of the current section. sections.append( _LttngMetadataStreamSection( -- 2.34.1