From 888d7f196d5891b58098cd415edb5dcc8b459bc2 Mon Sep 17 00:00:00 2001 From: "Carsey, Jaben" Date: Sat, 14 Apr 2018 04:51:32 +0800 Subject: [PATCH] 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 --- BaseTools/Source/Python/build/build.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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