From: "Zhu, Yonghong" <yonghong.zhu@intel.com>
To: "Feng, YunhuaX" <yunhuax.feng@intel.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Gao, Liming" <liming.gao@intel.com>,
"Zhu, Yonghong" <yonghong.zhu@intel.com>
Subject: Re: [PATCH 1/1] BaseTools: Fix BPDG tool print traceback info issue
Date: Fri, 26 Oct 2018 02:37:28 +0000 [thread overview]
Message-ID: <B9726D6DCCFB8B4CA276A9169B02216D52164108@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <47C64442C08CCD4089DC43B6B5E46BC49063F7@shsmsx102.ccr.corp.intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Best Regards,
Zhu Yonghong
-----Original Message-----
From: Feng, YunhuaX
Sent: Thursday, October 25, 2018 1:51 PM
To: edk2-devel@lists.01.org
Cc: Zhu, Yonghong <yonghong.zhu@intel.com>; Gao, Liming <liming.gao@intel.com>
Subject: [PATCH 1/1] 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>
---
BaseTools/Source/Python/BPDG/BPDG.py | 5 ++++-
BaseTools/Source/Python/Common/VpdInfoFile.py | 5 ++---
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/BaseTools/Source/Python/BPDG/BPDG.py b/BaseTools/Source/Python/BPDG/BPDG.py
index 2ec1516c0a..c30e062a69 100644
--- a/BaseTools/Source/Python/BPDG/BPDG.py
+++ b/BaseTools/Source/Python/BPDG/BPDG.py
@@ -151,11 +151,14 @@ def StartBpdg(InputFileName, MapFileName, VpdFileName, Force):
GenVPD.GenerateVpdFile(MapFileName, VpdFileName)
EdkLogger.info("- Vpd pcd fixed done! -")
if __name__ == '__main__':
- r = 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)
diff --git a/BaseTools/Source/Python/Common/VpdInfoFile.py b/BaseTools/Source/Python/Common/VpdInfoFile.py
index 0485bf482e..2fb8e66fe9 100644
--- a/BaseTools/Source/Python/Common/VpdInfoFile.py
+++ b/BaseTools/Source/Python/Common/VpdInfoFile.py
@@ -252,11 +252,10 @@ def CallExtenalBPDGTool(ToolPath, VpdFileName):
print(out)
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" % \
+ 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"
+ % \
(PopenObject.returncode, str(error)))
return PopenObject.returncode
--
2.12.2.windows.2
prev parent reply other threads:[~2018-10-26 2:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-25 5:51 [PATCH 1/1] BaseTools: Fix BPDG tool print traceback info issue Feng, YunhuaX
2018-10-26 2:37 ` Zhu, Yonghong [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=B9726D6DCCFB8B4CA276A9169B02216D52164108@SHSMSX103.ccr.corp.intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox