From 1b2e077260030290c512f3ac71a044ed1150899f Mon Sep 17 00:00:00 2001 From: Yonghong Zhu Date: Tue, 4 Sep 2018 10:39:47 +0800 Subject: BaseTools/UPT: Porting UPT Tool from Python2 to Python3 Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu Reviewed-by: Liming Gao --- BaseTools/Source/Python/UPT/Parser/InfSectionParser.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'BaseTools/Source/Python/UPT/Parser/InfSectionParser.py') diff --git a/BaseTools/Source/Python/UPT/Parser/InfSectionParser.py b/BaseTools/Source/Python/UPT/Parser/InfSectionParser.py index 1f254058d1..44243b467b 100644 --- a/BaseTools/Source/Python/UPT/Parser/InfSectionParser.py +++ b/BaseTools/Source/Python/UPT/Parser/InfSectionParser.py @@ -206,7 +206,7 @@ class InfSectionParser(InfDefinSectionParser, if FilePath in cls.MetaFiles: return cls.MetaFiles[FilePath] else: - ParserObject = super(InfSectionParser, cls).__new__(cls) + ParserObject = super().__new__(cls) cls.MetaFiles[FilePath] = ParserObject return ParserObject @@ -227,7 +227,7 @@ class InfSectionParser(InfDefinSectionParser, self.InfBuildOptionSection = InfBuildOptionsObject() self.InfLibraryClassSection = InfLibraryClassObject() self.InfPackageSection = InfPackageObject() - self.InfPcdSection = InfPcdObject(self.MetaFiles.keys()[0]) + self.InfPcdSection = InfPcdObject(list(self.MetaFiles.keys())[0]) self.InfSourcesSection = InfSourcesObject() self.InfUserExtensionSection = InfUserExtensionObject() self.InfProtocolSection = InfProtocolObject() @@ -455,7 +455,7 @@ class InfSectionParser(InfDefinSectionParser, Arch = Match.groups(1)[0].upper() ArchList.append(Arch) CommentSoFar = '' - for Index in xrange(1, len(List)): + for Index in range(1, len(List)): Result = ParseComment(List[Index], DT.ALL_USAGE_TOKENS, TokenDict, [], False) Usage = Result[0] Type = Result[1] -- cgit v1.2.3