Skip to content

Commit

Permalink
Partial revert - keep mypy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
spookylukey committed Oct 9, 2024
1 parent ab72d81 commit ab77a96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pyastgrep/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def get_context_lines_for_result(self, result: Match) -> tuple[int, int]:
statement_node = ast_utils.get_ast_statement_node(result_node)
first_line = statement_node.lineno # type: ignore [attr-defined]
if hasattr(statement_node, "decorator_list"):
decorator_list = statement_node.decorator_list # type: ignore [attr-defined]
decorator_list = statement_node.decorator_list
first_line = min((first_line, *(n.lineno for n in decorator_list)))
before_context = result_node.lineno - first_line # type: ignore [attr-defined]
if isinstance(statement_node.end_lineno, int): # type: ignore [attr-defined]
Expand Down

0 comments on commit ab77a96

Please sign in to comment.