Skip to content

Commit

Permalink
move tag_exceptions to higher scope
Browse files Browse the repository at this point in the history
  • Loading branch information
sandbubbles committed Dec 31, 2024
1 parent 789ef06 commit df6feee
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions vyper/semantics/analysis/imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,11 @@ def _resolve_imports_r(self, module_ast: vy_ast.Module):
return
with self.graph.enter_path(module_ast):
for node in module_ast.body:
if isinstance(node, vy_ast.Import):
self._handle_Import(node)
elif isinstance(node, vy_ast.ImportFrom):
self._handle_ImportFrom(node)
with tag_exceptions(node):
if isinstance(node, vy_ast.Import):
self._handle_Import(node)
elif isinstance(node, vy_ast.ImportFrom):
self._handle_ImportFrom(node)
self.seen.add(id(module_ast))

def _handle_Import(self, node: vy_ast.Import):
Expand Down Expand Up @@ -148,11 +149,10 @@ def _handle_ImportFrom(self, node: vy_ast.ImportFrom):
def _add_import(
self, node: vy_ast.VyperNode, level: int, qualified_module_name: str, alias: str
) -> None:
with tag_exceptions(node):
compiler_input, ast = self._load_import(node, level, qualified_module_name, alias)
node._metadata["import_info"] = ImportInfo(
alias, qualified_module_name, compiler_input, ast
)
compiler_input, ast = self._load_import(node, level, qualified_module_name, alias)
node._metadata["import_info"] = ImportInfo(
alias, qualified_module_name, compiler_input, ast
)

# load an InterfaceT or ModuleInfo from an import.
# raises FileNotFoundError
Expand Down

0 comments on commit df6feee

Please sign in to comment.