Skip to content

Commit b05c950

Browse files
committed
fix(python): use imports to resolve inheritance bases
Resolving ambiguous symbol names during inheritance detection by taking the import context into account.
1 parent 35985ed commit b05c950

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

internal/extractors/pythonextractor/python_ast.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,9 @@ func (w *pyWalker) handleClass(node *sitter.Node, decorators []string) {
795795
switch c.Kind() {
796796
case "identifier":
797797
base := pyText(c, w.src)
798+
if imported := w.importMap[base]; imported != "" {
799+
base = imported
800+
}
798801
bases = append(bases, base)
799802
rels = append(rels, facts.Relation{Kind: facts.RelImplements, Target: base})
800803
case "attribute":

0 commit comments

Comments
 (0)