From: Michael Jeanson Date: Tue, 15 Aug 2023 20:43:03 +0000 (-0400) Subject: fix: make flake8 6.x happy X-Git-Tag: v2.0.6~17 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=dec310fde93a55d81d89145f37fce9b80db1f10a fix: make flake8 6.x happy ./src/bindings/python/bt2/bt2/trace_collection_message_iterator.py:143:12: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()` ./src/bindings/python/bt2/bt2/trace_collection_message_iterator.py:151:12: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()` ./src/bindings/python/bt2/bt2/trace_collection_message_iterator.py:156:16: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()` ./src/bindings/python/bt2/bt2/trace_collection_message_iterator.py:160:16: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()` ./src/bindings/python/bt2/bt2/trace_collection_message_iterator.py:164:16: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()` ./src/bindings/python/bt2/bt2/trace_collection_message_iterator.py:168:16: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()` ./tests/data/auto-source-discovery/params-log-level/bt_plugin_test.py:33:20: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()` Change-Id: I388dfe9b1c8fa7030a805e6c6e0e487e56947616 Signed-off-by: Michael Jeanson Reviewed-on: https://review.lttng.org/c/babeltrace/+/10612 Reviewed-by: Simon Marchi Tested-by: jenkins Reviewed-on: https://review.lttng.org/c/babeltrace/+/10619 Reviewed-by: Philippe Proulx --- diff --git a/src/bindings/python/bt2/bt2/trace_collection_message_iterator.py b/src/bindings/python/bt2/bt2/trace_collection_message_iterator.py index 101d0017..03132cc2 100644 --- a/src/bindings/python/bt2/bt2/trace_collection_message_iterator.py +++ b/src/bindings/python/bt2/bt2/trace_collection_message_iterator.py @@ -158,7 +158,7 @@ def _auto_discover_source_component_specs(auto_source_comp_specs, plugin_set): res = bt2_value._create_from_ptr(res_ptr) - assert type(res) == bt2.MapValue + assert type(res) is bt2.MapValue assert 'status' in res status = res['status'] @@ -166,24 +166,24 @@ def _auto_discover_source_component_specs(auto_source_comp_specs, plugin_set): comp_specs = [] comp_specs_raw = res['results'] - assert type(comp_specs_raw) == bt2.ArrayValue + assert type(comp_specs_raw) is bt2.ArrayValue used_input_indices = set() for comp_spec_raw in comp_specs_raw: - assert type(comp_spec_raw) == bt2.ArrayValue + assert type(comp_spec_raw) is bt2.ArrayValue assert len(comp_spec_raw) == 4 plugin_name = comp_spec_raw[0] - assert type(plugin_name) == bt2.StringValue + assert type(plugin_name) is bt2.StringValue plugin_name = str(plugin_name) class_name = comp_spec_raw[1] - assert type(class_name) == bt2.StringValue + assert type(class_name) is bt2.StringValue class_name = str(class_name) comp_inputs = comp_spec_raw[2] - assert type(comp_inputs) == bt2.ArrayValue + assert type(comp_inputs) is bt2.ArrayValue comp_orig_indices = comp_spec_raw[3] assert type(comp_orig_indices) diff --git a/tests/data/auto-source-discovery/params-log-level/bt_plugin_test.py b/tests/data/auto-source-discovery/params-log-level/bt_plugin_test.py index ddbf9771..279574e4 100644 --- a/tests/data/auto-source-discovery/params-log-level/bt_plugin_test.py +++ b/tests/data/auto-source-discovery/params-log-level/bt_plugin_test.py @@ -25,7 +25,7 @@ class TestIter(bt2._UserMessageIterator): log_level = self._component.logging_level stream_name = '{}: {}'.format(comp_cls_name, log_level) elif params['what'] == 'python-obj': - assert type(obj) == str or obj is None + assert type(obj) is str or obj is None stream_name = '{}: {}'.format(comp_cls_name, obj) else: assert False