Skip to content

Commit

Permalink
Do not use the | type syntax.
Browse files Browse the repository at this point in the history
  • Loading branch information
johndoknjas committed Oct 23, 2024
1 parent 3781310 commit 8b43c0e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vulture/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pathlib
import sys
import tokenize
from typing import Optional
from typing import Optional, Union


class VultureInputException(Exception):
Expand Down Expand Up @@ -120,7 +120,7 @@ def add_parents(root: ast.AST) -> None:
child.parent = node


def parent(node: Optional[ast.AST]) -> ast.AST | None:
def parent(node: Optional[ast.AST]) -> Optional[ast.AST]:
return getattr(node, "parent", None)


Expand All @@ -141,7 +141,7 @@ def call_info_no_args(call_node: ast.Call) -> str:
return ast.unparse(call_node).split("(")[0]


def recursive_call(node: ast.Name | ast.Attribute) -> Optional[bool]:
def recursive_call(node: Union[ast.Name, ast.Attribute]) -> Optional[bool]:
"""Returns a boolean if it can be determined the node is part of a recursive call.
Otherwise if the function is nested in a complicated way, `None` is returned."""
if not isinstance((call_node := parent(node)), ast.Call) or not (
Expand Down

0 comments on commit 8b43c0e

Please sign in to comment.