From 6563ac7618624e2b18b48555c0788687d47013a8 Mon Sep 17 00:00:00 2001 From: Akshita Bhagia Date: Mon, 18 Sep 2023 11:49:10 -0700 Subject: [PATCH] fix lint error --- tango/common/from_params.py | 2 +- tests/common/from_params_test.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tango/common/from_params.py b/tango/common/from_params.py index 9575c887..fb7bf63b 100644 --- a/tango/common/from_params.py +++ b/tango/common/from_params.py @@ -514,7 +514,7 @@ def construct_arg( ) elif annotation == str: # Strings are special because we allow casting from Path to str. - if type(popped_params) == str or isinstance(popped_params, Path): + if isinstance(popped_params, str) or isinstance(popped_params, Path): return str(popped_params) # type: ignore else: raise TypeError( diff --git a/tests/common/from_params_test.py b/tests/common/from_params_test.py index 4c0bc4af..40c983d2 100644 --- a/tests/common/from_params_test.py +++ b/tests/common/from_params_test.py @@ -470,7 +470,7 @@ def __init__(self, a: str, x: int = 42, **kwargs): assert instance.x == 42 assert instance.a == -1 assert len(instance.rest) == 1 # type: ignore - assert type(instance.rest["raw_a"]) == str # type: ignore + assert isinstance(instance.rest["raw_a"], str) # type: ignore assert instance.rest["raw_a"] == "123" # type: ignore def test_kwargs_are_passed_to_deeper_superclasses(self):