File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -33,19 +33,22 @@ def get_full_module_path(self) -> str:
3333 def resolve (self , full_path : str , level = 0 ) -> str | None :
3434 """Return the lowest import of a member in the tree."""
3535 name = full_path .split ("." )[- 1 ]
36+ modules = full_path .split ("." )
3637
3738 # Find an import in this module likely to be the one we want.
3839 for imp in self .imports :
3940 if imp .name == name and imp .from_module in full_path :
40- print (f"Found: { imp .name } in { imp .module } " )
41+ # print(f"Found: {imp.name} in {imp.module}")
4142 return f"{ imp .module } .{ imp .name } "
4243
4344 # Move on to children
45+ module = modules [level + 1 ]
4446 for child in self .children :
45- print (f"Checking child: { child .name } " )
46- result = child .resolve (full_path , level + 1 )
47- if result :
48- return result
47+ if child .name == module :
48+ # print(f"Checking child: {child.name}")
49+ result = child .resolve (full_path , level + 1 )
50+ if result :
51+ return result
4952
5053 # We're back from recursing and didn't find anything.
5154 if level == 0 :
You can’t perform that action at this time.
0 commit comments