]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: use dictionary.get() when we have value if not found
authorCarsey, Jaben </o=Intel/ou=Americas01/cn=Workers/cn=Carsey, Jaben>
Fri, 13 Apr 2018 20:51:32 +0000 (04:51 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Tue, 17 Apr 2018 12:49:53 +0000 (20:49 +0800)
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>
BaseTools/Source/Python/build/build.py

index 6fb2e0ed3d0966f0a171b19c2ef29970277c3f98..ede963bc231ae7105d865f23b22f2dcfa0595ce5 100644 (file)
@@ -1604,9 +1604,7 @@ class Build():
                         SmmModuleList[Module.MetaFile] = ImageInfo\r
                         SmmSize += ImageInfo.Image.Size\r
                         if Module.ModuleType == 'DXE_SMM_DRIVER':\r
-                            PiSpecVersion = '0x00000000'\r
-                            if 'PI_SPECIFICATION_VERSION' in Module.Module.Specification:\r
-                                PiSpecVersion = Module.Module.Specification['PI_SPECIFICATION_VERSION']\r
+                            PiSpecVersion = Module.Module.Specification.get('PI_SPECIFICATION_VERSION', '0x00000000')\r
                             # for PI specification < PI1.1, DXE_SMM_DRIVER also runs as BOOT time driver.\r
                             if int(PiSpecVersion, 16) < 0x0001000A:\r
                                 BtModuleList[Module.MetaFile] = ImageInfo\r