Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit b64199b

Browse files
committed
py37 compat
1 parent 9ec346f commit b64199b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

flake8_idom_hooks/exhaustive_deps.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ def _get_dependency_names_from_expression(
141141
)
142142
return dep_names
143143
elif not (
144-
isinstance(dependency_expr, ast.Constant) and dependency_expr.value is None
144+
isinstance(dependency_expr, (ast.Constant, ast.NameConstant))
145+
and dependency_expr.value is None
145146
):
146147
self._save_error(
147148
201,

flake8_idom_hooks/run.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import ast
44

5+
from .utils import ErrorVisitor
56
from .exhaustive_deps import ExhaustiveDepsVisitor
67
from .rules_of_hooks import RulesOfHooksVisitor
78

@@ -10,7 +11,7 @@ def run_checks(
1011
tree: ast.Module,
1112
exhaustive_hook_deps: bool,
1213
) -> list[tuple[int, int, str]]:
13-
visitor_types = [RulesOfHooksVisitor]
14+
visitor_types: list[type[ErrorVisitor]] = [RulesOfHooksVisitor]
1415
if exhaustive_hook_deps:
1516
visitor_types.append(ExhaustiveDepsVisitor)
1617

0 commit comments

Comments
 (0)