From 1ccc4d895dd8d659d016efcd6ef8a48749aba1d0 Mon Sep 17 00:00:00 2001 From: Liming Gao Date: Mon, 15 Oct 2018 08:27:53 +0800 Subject: Revert BaseTools: PYTHON3 migration This reverts commit 6693f359b3c213513c5096a06c6f67244a44dc52.. 678f85131238622e576705117e299d81cff755c9. Python3 migration is the fundamental change. It requires every developer to install Python3. Before this migration, the well communication and wide verification must be done. But now, most people is not aware of this change, and not try it. So, Python3 migration is reverted and be moved to edk2-staging Python3 branch for the edk2 user evaluation. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao --- BaseTools/Source/Python/Ecc/CodeFragmentCollector.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'BaseTools/Source/Python/Ecc/CodeFragmentCollector.py') diff --git a/BaseTools/Source/Python/Ecc/CodeFragmentCollector.py b/BaseTools/Source/Python/Ecc/CodeFragmentCollector.py index b6fa287cf7..d12232cc6f 100644 --- a/BaseTools/Source/Python/Ecc/CodeFragmentCollector.py +++ b/BaseTools/Source/Python/Ecc/CodeFragmentCollector.py @@ -22,7 +22,7 @@ import re import Common.LongFilePathOs as os import sys -import antlr4 +import antlr3 from Ecc.CLexer import CLexer from Ecc.CParser import CParser @@ -499,14 +499,13 @@ class CodeFragmentCollector: def ParseFile(self): self.PreprocessFile() # restore from ListOfList to ListOfString - # print(self.Profile.FileLinesList) self.Profile.FileLinesList = ["".join(list) for list in self.Profile.FileLinesList] FileStringContents = '' for fileLine in self.Profile.FileLinesList: FileStringContents += fileLine - cStream = antlr4.InputStream(FileStringContents) + cStream = antlr3.StringStream(FileStringContents) lexer = CLexer(cStream) - tStream = antlr4.CommonTokenStream(lexer) + tStream = antlr3.CommonTokenStream(lexer) parser = CParser(tStream) parser.translation_unit() @@ -517,9 +516,9 @@ class CodeFragmentCollector: FileStringContents = '' for fileLine in self.Profile.FileLinesList: FileStringContents += fileLine - cStream = antlr4.InputStream(FileStringContents) + cStream = antlr3.StringStream(FileStringContents) lexer = CLexer(cStream) - tStream = antlr4.CommonTokenStream(lexer) + tStream = antlr3.CommonTokenStream(lexer) parser = CParser(tStream) parser.translation_unit() -- cgit v1.2.3