diff options
author | Gary Lin <glin@suse.com> | 2018-06-25 18:31:29 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2018-06-27 16:33:23 +0800 |
commit | 27c4ceb41cf6b79d440deae215c68e117d69d641 (patch) | |
tree | 07b096fb976ac5d38043580f1724092f3c7be427 /BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py | |
parent | 890d8ede6867dd43d96b5b04454f0b571938e3a3 (diff) | |
download | edk2-27c4ceb41cf6b79d440deae215c68e117d69d641.tar.gz edk2-27c4ceb41cf6b79d440deae215c68e117d69d641.tar.bz2 edk2-27c4ceb41cf6b79d440deae215c68e117d69d641.zip |
BaseTools: Remove the deprecated hash_key()
Replace "has_key()" with "in" to be compatible with python3.
Based on "futurize -f lib2to3.fixes.fix_has_key"
Contributed-under: TianoCore Contribution Agreement 1.1
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py')
-rw-r--r-- | BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py b/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py index bfd422b196..b97b319e09 100644 --- a/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py +++ b/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py @@ -438,14 +438,14 @@ def GenLibraryClasses(ModuleObject): Statement = '# Guid: ' + LibraryItem.Guid + ' Version: ' + LibraryItem.Version
if len(BinaryFile.SupArchList) == 0:
- if LibraryClassDict.has_key('COMMON') and Statement not in LibraryClassDict['COMMON']:
+ if 'COMMON' in LibraryClassDict and Statement not in LibraryClassDict['COMMON']:
LibraryClassDict['COMMON'].append(Statement)
else:
LibraryClassDict['COMMON'] = ['## @LIB_INSTANCES']
LibraryClassDict['COMMON'].append(Statement)
else:
for Arch in BinaryFile.SupArchList:
- if LibraryClassDict.has_key(Arch):
+ if Arch in LibraryClassDict:
if Statement not in LibraryClassDict[Arch]:
LibraryClassDict[Arch].append(Statement)
else:
@@ -917,14 +917,14 @@ def GenAsBuiltPacthPcdSections(ModuleObject): if FileNameObjList:
ArchList = FileNameObjList[0].GetSupArchList()
if len(ArchList) == 0:
- if PatchPcdDict.has_key(DT.TAB_ARCH_COMMON):
+ if DT.TAB_ARCH_COMMON in PatchPcdDict:
if Statement not in PatchPcdDict[DT.TAB_ARCH_COMMON]:
PatchPcdDict[DT.TAB_ARCH_COMMON].append(Statement)
else:
PatchPcdDict[DT.TAB_ARCH_COMMON] = [Statement]
else:
for Arch in ArchList:
- if PatchPcdDict.has_key(Arch):
+ if Arch in PatchPcdDict:
if Statement not in PatchPcdDict[Arch]:
PatchPcdDict[Arch].append(Statement)
else:
@@ -967,13 +967,13 @@ def GenAsBuiltPcdExSections(ModuleObject): ArchList = FileNameObjList[0].GetSupArchList()
if len(ArchList) == 0:
- if PcdExDict.has_key('COMMON'):
+ if 'COMMON' in PcdExDict:
PcdExDict['COMMON'].append(Statement)
else:
PcdExDict['COMMON'] = [Statement]
else:
for Arch in ArchList:
- if PcdExDict.has_key(Arch):
+ if Arch in PcdExDict:
if Statement not in PcdExDict[Arch]:
PcdExDict[Arch].append(Statement)
else:
@@ -1071,7 +1071,7 @@ def GenBuildOptions(ModuleObject): for BuilOptionItem in BinaryFile.AsBuiltList[0].BinaryBuildFlagList:
Statement = '#' + BuilOptionItem.AsBuiltOptionFlags
if len(BinaryFile.SupArchList) == 0:
- if BuildOptionDict.has_key('COMMON'):
+ if 'COMMON' in BuildOptionDict:
if Statement not in BuildOptionDict['COMMON']:
BuildOptionDict['COMMON'].append(Statement)
else:
@@ -1079,7 +1079,7 @@ def GenBuildOptions(ModuleObject): BuildOptionDict['COMMON'].append(Statement)
else:
for Arch in BinaryFile.SupArchList:
- if BuildOptionDict.has_key(Arch):
+ if Arch in BuildOptionDict:
if Statement not in BuildOptionDict[Arch]:
BuildOptionDict[Arch].append(Statement)
else:
|