diff --git a/mypy/build.py b/mypy/build.py index 4522bd1255fb..b8b60bbf04ac 100644 --- a/mypy/build.py +++ b/mypy/build.py @@ -2875,9 +2875,10 @@ def semantic_analysis_pass1(self) -> None: # # TODO: This should not be considered as a semantic analysis # pass -- it's an independent pass. - analyzer = SemanticAnalyzerPreAnalysis() - with self.wrap_context(): - analyzer.visit_file(self.tree, self.xpath, self.id, options) + if not options.native_parser: + analyzer = SemanticAnalyzerPreAnalysis() + with self.wrap_context(): + analyzer.visit_file(self.tree, self.xpath, self.id, options) # TODO: Do this while constructing the AST? self.tree.names = SymbolTable() if not self.tree.is_stub: