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>
EdkLogger.info("- Vpd pcd fixed done! -")\r
\r
if __name__ == '__main__':\r
EdkLogger.info("- Vpd pcd fixed done! -")\r
\r
if __name__ == '__main__':\r
+ try:\r
+ r = main()\r
+ except FatalError as e:\r
+ r = e\r
## 0-127 is a safe return range, and 1 is a standard default error\r
if r < 0 or r > 127: r = 1\r
sys.exit(r)\r
## 0-127 is a safe return range, and 1 is a standard default error\r
if r < 0 or r > 127: r = 1\r
sys.exit(r)\r
PopenObject.wait()\r
\r
if PopenObject.returncode != 0:\r
PopenObject.wait()\r
\r
if PopenObject.returncode != 0:\r
- if PopenObject.returncode != 0:\r
- EdkLogger.debug(EdkLogger.DEBUG_1, "Fail to call BPDG tool", str(error))\r
- EdkLogger.error("BPDG", BuildToolError.COMMAND_FAILURE, "Fail to execute BPDG tool with exit code: %d, the error message is: \n %s" % \\r
+ EdkLogger.debug(EdkLogger.DEBUG_1, "Fail to call BPDG tool", str(error))\r
+ EdkLogger.error("BPDG", BuildToolError.COMMAND_FAILURE, "Fail to execute BPDG tool with exit code: %d, the error message is: \n %s" % \\r
(PopenObject.returncode, str(error)))\r
\r
return PopenObject.returncode\r
(PopenObject.returncode, str(error)))\r
\r
return PopenObject.returncode\r