File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,6 @@ def fully_qualify_alias_labels(label, aliases):
8989 for alias , full_name in aliases .items ():
9090 if label == alias :
9191 return full_name
92- if label .startswith (alias + '.' ):
92+ elif label .startswith (alias + '.' ):
9393 return full_name + label [len (alias ):]
9494 return label
Original file line number Diff line number Diff line change 66
77from .alias_helper import (
88 as_alias_handler ,
9+ fully_qualify_alias_labels ,
910 handle_aliases_in_init_files ,
1011 handle_fdid_aliases ,
1112 not_as_alias_handler ,
12- retrieve_import_alias_mapping ,
13- fully_qualify_alias_labels
13+ retrieve_import_alias_mapping
1414)
1515from ..core .ast_helper import (
1616 generate_ast ,
@@ -816,6 +816,7 @@ def add_module( # noqa: C901
816816 module_path = module [1 ]
817817
818818 parent_definitions = self .module_definitions_stack [- 1 ]
819+ # Here, in `visit_Import` and in `visit_ImportFrom` are the only places the `import_alias_mapping` is updated
819820 parent_definitions .import_alias_mapping .update (import_alias_mapping )
820821 parent_definitions .import_names = local_names
821822
@@ -1106,7 +1107,7 @@ def visit_ImportFrom(self, node):
11061107 from_from = True
11071108 )
11081109
1109- # Remember aliases for uninspecatble modules such that we can label them fully qualified
1110+ # Remember aliases for uninspectable modules such that we can label them fully qualified
11101111 # e.g. we want a call to "os.system" be recognised, even if we do "from os import system"
11111112 # from os import system as mysystem -> module=os, name=system, asname=mysystem
11121113 for name in node .names :
You can’t perform that action at this time.
0 commit comments