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:
33
33
def resolve (self , full_path : str , level = 0 ) -> str | None :
34
34
"""Return the lowest import of a member in the tree."""
35
35
name = full_path .split ("." )[- 1 ]
36
+ modules = full_path .split ("." )
36
37
37
38
# Find an import in this module likely to be the one we want.
38
39
for imp in self .imports :
39
40
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}")
41
42
return f"{ imp .module } .{ imp .name } "
42
43
43
44
# Move on to children
45
+ module = modules [level + 1 ]
44
46
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
49
52
50
53
# We're back from recursing and didn't find anything.
51
54
if level == 0 :
You can’t perform that action at this time.
0 commit comments