BaseTools: use dictionary.get() when we have value if not found

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
This commit is contained in:
Carsey, Jaben 2018-04-14 04:51:32 +08:00 committed by Yonghong Zhu
parent fe1abb4beb
commit 888d7f196d
1 changed files with 1 additions and 3 deletions

View File

@ -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