|
6 | 6 |
|
7 | 7 | from .alias_helper import (
|
8 | 8 | as_alias_handler,
|
| 9 | + fully_qualify_alias_labels, |
9 | 10 | handle_aliases_in_init_files,
|
10 | 11 | handle_fdid_aliases,
|
11 | 12 | not_as_alias_handler,
|
12 | | - retrieve_import_alias_mapping, |
13 | | - fully_qualify_alias_labels |
| 13 | + retrieve_import_alias_mapping |
14 | 14 | )
|
15 | 15 | from ..core.ast_helper import (
|
16 | 16 | generate_ast,
|
@@ -816,6 +816,7 @@ def add_module( # noqa: C901
|
816 | 816 | module_path = module[1]
|
817 | 817 |
|
818 | 818 | 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 |
819 | 820 | parent_definitions.import_alias_mapping.update(import_alias_mapping)
|
820 | 821 | parent_definitions.import_names = local_names
|
821 | 822 |
|
@@ -1106,7 +1107,7 @@ def visit_ImportFrom(self, node):
|
1106 | 1107 | from_from=True
|
1107 | 1108 | )
|
1108 | 1109 |
|
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 |
1110 | 1111 | # e.g. we want a call to "os.system" be recognised, even if we do "from os import system"
|
1111 | 1112 | # from os import system as mysystem -> module=os, name=system, asname=mysystem
|
1112 | 1113 | for name in node.names:
|
|
0 commit comments