BaseTools: Fix BPDG tool print traceback info issue

Fix BPDG tool print traceback info issue
and remove abundant code

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
This commit is contained in:
Feng, YunhuaX 2018-10-25 13:51:01 +08:00 committed by Yonghong Zhu
parent e5001ab7a9
commit b28d406b5a
2 changed files with 6 additions and 4 deletions

View File

@ -153,7 +153,10 @@ def StartBpdg(InputFileName, MapFileName, VpdFileName, Force):
EdkLogger.info("- Vpd pcd fixed done! -")
if __name__ == '__main__':
try:
r = main()
except FatalError as e:
r = e
## 0-127 is a safe return range, and 1 is a standard default error
if r < 0 or r > 127: r = 1
sys.exit(r)

View File

@ -253,7 +253,6 @@ def CallExtenalBPDGTool(ToolPath, VpdFileName):
while PopenObject.returncode is None :
PopenObject.wait()
if PopenObject.returncode != 0:
if PopenObject.returncode != 0:
EdkLogger.debug(EdkLogger.DEBUG_1, "Fail to call BPDG tool", str(error))
EdkLogger.error("BPDG", BuildToolError.COMMAND_FAILURE, "Fail to execute BPDG tool with exit code: %d, the error message is: \n %s" % \