]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Fix BPDG tool print traceback info issue
authorFeng, YunhuaX <yunhuax.feng@intel.com>
Thu, 25 Oct 2018 05:51:01 +0000 (13:51 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Fri, 26 Oct 2018 12:27:35 +0000 (20:27 +0800)
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>
BaseTools/Source/Python/BPDG/BPDG.py
BaseTools/Source/Python/Common/VpdInfoFile.py

index 2ec1516c0a08da6b52ae6d0b4aafd91e0d82811d..c30e062a6953e12ecb827003c2042ee5553234dd 100644 (file)
@@ -153,7 +153,10 @@ def StartBpdg(InputFileName, MapFileName, VpdFileName, Force):
     EdkLogger.info("- Vpd pcd fixed done! -")\r
 \r
 if __name__ == '__main__':\r
-    r = 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
index 0485bf482ec0509f1af450e1b394137b80241282..2fb8e66fe99c9b6bfe47fcdf711b19b042425402 100644 (file)
@@ -254,9 +254,8 @@ def CallExtenalBPDGTool(ToolPath, VpdFileName):
         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