Skip to content

Commit

Permalink
Fix mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
kit1980 committed Feb 4, 2025
1 parent d991158 commit dfc9853
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions torchfix/visitors/misc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,14 @@ def visit_Call(self, node):
dim_arg = self.get_specific_arg(
node.args[0].value, arg_name="dim", arg_pos=1
)

if dim_arg is not None and dim_arg.value.value != "None":
self.add_violation(
node,
error_code=self.ERRORS[0].error_code,
message=self.ERRORS[0].message(),
replacement=None,
)
if dim_arg is not None:
if not (
isinstance(dim_arg.value, cst.Name)
and dim_arg.value.value == "None"
):
self.add_violation(
node,
error_code=self.ERRORS[0].error_code,
message=self.ERRORS[0].message(),
replacement=None,
)

0 comments on commit dfc9853

Please sign in to comment.