diff options
author | Carsey, Jaben </o=Intel/ou=Americas01/cn=Workers/cn=Carsey, Jaben> | 2018-04-14 04:51:32 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2018-04-17 20:49:53 +0800 |
commit | 888d7f196d5891b58098cd415edb5dcc8b459bc2 (patch) | |
tree | 657582460e07bf51cd2482bfe0fd8115b667b28c /BaseTools/Source/Python/build | |
parent | fe1abb4beb23a44820b028722c636050ccbc9c34 (diff) | |
download | edk2-888d7f196d5891b58098cd415edb5dcc8b459bc2.tar.gz edk2-888d7f196d5891b58098cd415edb5dcc8b459bc2.tar.bz2 edk2-888d7f196d5891b58098cd415edb5dcc8b459bc2.zip |
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>
Diffstat (limited to 'BaseTools/Source/Python/build')
-rw-r--r-- | BaseTools/Source/Python/build/build.py | 4 |
1 files changed, 1 insertions, 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
|