diff options
Diffstat (limited to 'BaseTools/Source/Python/AutoGen/PlatformAutoGen.py')
-rw-r--r-- | BaseTools/Source/Python/AutoGen/PlatformAutoGen.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py index 0e424ee40f..debeb46f58 100644 --- a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py +++ b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py @@ -275,11 +275,11 @@ class PlatformAutoGen(AutoGen): PcdNvStoreDfBuffer = [item for item in self._DynamicPcdList if item.TokenCName == "PcdNvStoreDefaultValueBuffer" and item.TokenSpaceGuidCName == "gEfiMdeModulePkgTokenSpaceGuid"]
if PcdNvStoreDfBuffer:
- if os.path.exists(VpdMapFilePath):
+ try:
OrgVpdFile.Read(VpdMapFilePath)
PcdItems = OrgVpdFile.GetOffset(PcdNvStoreDfBuffer[0])
NvStoreOffset = list(PcdItems.values())[0].strip() if PcdItems else '0'
- else:
+ except:
EdkLogger.error("build", FILE_READ_FAILURE, "Can not find VPD map file %s to fix up VPD offset." % VpdMapFilePath)
NvStoreOffset = int(NvStoreOffset, 16) if NvStoreOffset.upper().startswith("0X") else int(NvStoreOffset)
@@ -665,7 +665,7 @@ class PlatformAutoGen(AutoGen): # Process VPD map file generated by third party BPDG tool
if NeedProcessVpdMapFile:
VpdMapFilePath = os.path.join(self.BuildDir, TAB_FV_DIRECTORY, "%s.map" % self.Platform.VpdToolGuid)
- if os.path.exists(VpdMapFilePath):
+ try:
VpdFile.Read(VpdMapFilePath)
# Fixup TAB_STAR offset
@@ -679,7 +679,7 @@ class PlatformAutoGen(AutoGen): for item in vpdinfo:
if item[2] == pcdvalue:
sku.VpdOffset = item[1]
- else:
+ except:
EdkLogger.error("build", FILE_READ_FAILURE, "Can not find VPD map file %s to fix up VPD offset." % VpdMapFilePath)
# Delete the DynamicPcdList At the last time enter into this function
|