BaseTools/UPT: Porting UPT Tool from Python2 to Python3
Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
@ -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]
|
||||
|
Reference in New Issue
Block a user