Skip to content

Commit 94309b0

Browse files
author
Ivan Levkivskyi
committed
More straightforward fix
1 parent bc19615 commit 94309b0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

mypy/semanal.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,8 @@ def visit_file(self, file_node: MypyFile, fnam: str, options: Options) -> None:
253253

254254
if self.cur_mod_id == 'builtins':
255255
remove_imported_names_from_symtable(self.globals, 'builtins')
256+
for alias_name in ['List', 'Dict', 'Set']:
257+
self.globals.pop(alias_name, None)
256258

257259
if '__all__' in self.globals:
258260
for name, g in self.globals.items():
@@ -3453,9 +3455,6 @@ def remove_imported_names_from_symtable(names: SymbolTable,
34533455
removed.append(name)
34543456
for name in removed:
34553457
del names[name]
3456-
if module == 'builtins':
3457-
for alias_name in ['List', 'Dict', 'Set']:
3458-
names.pop(alias_name, None)
34593458

34603459

34613460
def infer_reachability_of_if_statement(s: IfStmt,

0 commit comments

Comments
 (0)