Skip to content

Commit 9d5ea09

Browse files
committed
Revert PR python#3205 and python#3235
1 parent 665a810 commit 9d5ea09

File tree

2 files changed

+0
-12
lines changed

2 files changed

+0
-12
lines changed

mypy/fixup.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
)
1616
from mypy.visitor import NodeVisitor
1717

18-
from mypy.semanal import rev_module_rename_map
19-
2018

2119
def fixup_module_pass_one(tree: MypyFile, modules: Dict[str, MypyFile],
2220
quick_and_dirty: bool) -> None:
@@ -243,9 +241,6 @@ def lookup_qualified(modules: Dict[str, MypyFile], name: str,
243241

244242
def lookup_qualified_stnode(modules: Dict[str, MypyFile], name: str,
245243
quick_and_dirty: bool) -> Optional[SymbolTableNode]:
246-
if '_importlib_modulespec' in modules:
247-
# we are using python 3, so renaming is necessary
248-
name = rev_module_rename_map.get(name, name)
249244
head = name
250245
rest = []
251246
while True:

mypy/semanal.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,20 +117,13 @@
117117
'typing.typevar': 'typing.TypeVar',
118118
}
119119

120-
# Used for python 3 only
121120
# Rename objects placed in _importlib_modulespec due to circular imports
122-
# Safe in python 2 because no one will ask for these keys
123121
module_rename_map = {
124122
'_importlib_modulespec.ModuleType': 'types.ModuleType',
125123
'_importlib_modulespec.ModuleSpec': 'importlib.machinery.ModuleSpec',
126124
'_importlib_modulespec.Loader': 'importlib.abc.Loader'
127125
}
128126

129-
# Must not be used in python 2 (it will replace correct names with incorrect)
130-
# The check for version is currently made at the point of use
131-
# TODO: consider moving these maps from global scope to somewhere where python version is known
132-
rev_module_rename_map = {v: k for (k, v) in module_rename_map.items()}
133-
134127
# Hard coded type promotions (shared between all Python versions).
135128
# These add extra ad-hoc edges to the subtyping relation. For example,
136129
# int is considered a subtype of float, even though there is no

0 commit comments

Comments
 (0)