From 2305ac05bd86e0b1b9a275759144d8fa73d8b7f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Wed, 25 Oct 2023 01:41:35 +0100 Subject: [PATCH] Fix flake8 linting issues. --- scripts/neohub_cli.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/neohub_cli.py b/scripts/neohub_cli.py index 6c00cae..18366ca 100755 --- a/scripts/neohub_cli.py +++ b/scripts/neohub_cli.py @@ -91,9 +91,9 @@ class NeoHubCLI(object): arg_types = [] for p in sig.parameters: a = sig.parameters[p].annotation - if type(a) == type: + if isinstance(a, type): arg_types.append(a) - elif type(a) == list: + elif isinstance(a, list): if a[0] == NeoStat: arg_types.append(a[0]) else: @@ -204,14 +204,14 @@ class NeoHubCLI(object): if special_case: return special_case(raw_result, output_format) - if type(raw_result) == bool: + if isinstance(raw_result, bool): return 'Command Succeeded' if raw_result else 'Command Failed' if type(raw_result) in (int, str): return f'{raw_result}' - if type(raw_result) != types.SimpleNamespace: - if type(raw_result) == dict: + if not isinstance(raw_result, types.SimpleNamespace): + if isinstance(raw_result, dict): raw_result = types.SimpleNamespace(**raw_result) else: raise NeoHubCLIInternalError( @@ -225,7 +225,7 @@ class NeoHubCLI(object): """ if type(val) in (ScheduleFormat, Weekday): return val.value - elif type(val) == NeoStat: + elif isinstance(val, NeoStat): return f'[NeoStat: {val.name}]' else: return val