Skip to content

Commit

Permalink
make lint happy
Browse files Browse the repository at this point in the history
  • Loading branch information
AkshitaB committed Sep 14, 2023
1 parent b5a65d6 commit 0c2d101
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tango/common/from_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion tests/common/from_params_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 0c2d101

Please sign in to comment.