From: Carsey, Jaben Date: Fri, 13 Apr 2018 20:51:32 +0000 (+0800) Subject: BaseTools: use dictionary.get() when we have value if not found X-Git-Tag: edk2-stable201903~1881 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=888d7f196d5891b58098cd415edb5dcc8b459bc2 BaseTools: use dictionary.get() when we have value if not found Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu --- diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py index 6fb2e0ed3d..ede963bc23 100644 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -1604,9 +1604,7 @@ class Build(): SmmModuleList[Module.MetaFile] = ImageInfo SmmSize += ImageInfo.Image.Size if Module.ModuleType == 'DXE_SMM_DRIVER': - PiSpecVersion = '0x00000000' - if 'PI_SPECIFICATION_VERSION' in Module.Module.Specification: - PiSpecVersion = Module.Module.Specification['PI_SPECIFICATION_VERSION'] + PiSpecVersion = Module.Module.Specification.get('PI_SPECIFICATION_VERSION', '0x00000000') # for PI specification < PI1.1, DXE_SMM_DRIVER also runs as BOOT time driver. if int(PiSpecVersion, 16) < 0x0001000A: BtModuleList[Module.MetaFile] = ImageInfo