Skip to content

Commit e7d9f2d

Browse files
authored
Skip semantic analysis pass 1 for native parser (#21015)
This should not be needed anymore after recent `ast_serialize` changes.
1 parent 1e516b2 commit e7d9f2d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

mypy/build.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2875,9 +2875,10 @@ def semantic_analysis_pass1(self) -> None:
28752875
#
28762876
# TODO: This should not be considered as a semantic analysis
28772877
# pass -- it's an independent pass.
2878-
analyzer = SemanticAnalyzerPreAnalysis()
2879-
with self.wrap_context():
2880-
analyzer.visit_file(self.tree, self.xpath, self.id, options)
2878+
if not options.native_parser:
2879+
analyzer = SemanticAnalyzerPreAnalysis()
2880+
with self.wrap_context():
2881+
analyzer.visit_file(self.tree, self.xpath, self.id, options)
28812882
# TODO: Do this while constructing the AST?
28822883
self.tree.names = SymbolTable()
28832884
if not self.tree.is_stub:

0 commit comments

Comments
 (0)