fix: apply ruff formatting
This commit is contained in:
parent
437ffe7c03
commit
e1e8dc43cd
1 changed files with 8 additions and 5 deletions
|
|
@ -273,14 +273,17 @@ def get_imports_from_source_code(source_code: str) -> dict[str, tuple[str, str]]
|
|||
for alias in node.names:
|
||||
available_name = alias.asname if alias.asname else alias.name.split(".")[0]
|
||||
imports[available_name] = (alias.name, alias.name)
|
||||
elif isinstance(node, (ast.If, ast.Try, ast.With, ast.For, ast.While, ast.FunctionDef, ast.AsyncFunctionDef, ast.ClassDef)):
|
||||
if hasattr(node, 'body'):
|
||||
elif isinstance(
|
||||
node,
|
||||
(ast.If, ast.Try, ast.With, ast.For, ast.While, ast.FunctionDef, ast.AsyncFunctionDef, ast.ClassDef),
|
||||
):
|
||||
if hasattr(node, "body"):
|
||||
process_body(node.body)
|
||||
if hasattr(node, 'orelse'):
|
||||
if hasattr(node, "orelse"):
|
||||
process_body(node.orelse)
|
||||
if hasattr(node, 'finalbody'):
|
||||
if hasattr(node, "finalbody"):
|
||||
process_body(node.finalbody)
|
||||
if hasattr(node, 'handlers'):
|
||||
if hasattr(node, "handlers"):
|
||||
for handler in node.handlers:
|
||||
process_body(handler.body)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue