Skip to content

Commit

Permalink
🐛 Patch unused-import detector
Browse files Browse the repository at this point in the history
  • Loading branch information
michprev committed Jun 21, 2024
1 parent 3e29c80 commit 95309fd
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions wake_detectors/unused_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,15 @@ def visit_source_unit(self, node: ir.SourceUnit):
for predecessor in graph_iter(
self.imports_graph, imported_source_unit_name, "in"
):
predecessor_path = (
self.imports_graph.nodes[ # pyright: ignore reportGeneralTypeIssues
try:
predecessor_path = self.imports_graph.nodes[ # pyright: ignore reportGeneralTypeIssues
predecessor
]["path"]
)
source_unit = self.build.source_units[predecessor_path]
][
"path"
]
source_unit = self.build.source_units[predecessor_path]
except KeyError:
continue

# should not be needed to check for aliases, as there still should be original global declarations referenced

Expand Down

0 comments on commit 95309fd

Please sign in to comment.