From: "Cheng, Ching JenX" <ching.jenx.cheng@intel.com>
To: devel@edk2.groups.io
Cc: Amy Chan <amy.chan@intel.com>,
Michael Kubacki <michael.a.kubacki@intel.com>,
Chasel Chiu <chasel.chiu@intel.com>,
Nate DeSimone <nathaniel.l.desimone@intel.com>,
Liming Gao <liming.gao@intel.com>
Subject: [PATCH] Python run fail if env variable PYTHON_HOME is not set
Date: Mon, 19 Aug 2019 15:21:28 +0800 [thread overview]
Message-ID: <20190819072128.15400-1-ching.jenx.cheng@intel.com> (raw)
BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=2041
In Platform\Intel\MinPlatformPkg\Tools\Fsp\RebaseFspBinBaseAddress.py
It will run another python code.
But if the environment variable "PYTHON_HOME" is not exist
and we didn't add any python's path to "PATH".
It will cause error because python command not found.
the error message as below:
'python' is not recognized as an internal or external command,
operable program or batch file.
So we set the python's path from which execute the python code
if PYTHON_HOME was not exist.
Cc: Amy Chan <amy.chan@intel.com>
Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Ching JenX Cheng <ching.jenx.cheng@intel.com>
---
Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAddress.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAddress.py b/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAddress.py
index 406e5ec130..1d72b4112f 100644
--- a/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAddress.py
+++ b/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAddress.py
@@ -76,6 +76,8 @@ file.close()
pythontool = 'python'
if 'PYTHON_HOME' in os.environ:
pythontool = os.environ['PYTHON_HOME'] + os.sep + 'python'
+else:
+ pythontool = sys.executable
Process = subprocess.Popen([pythontool, splitFspBinPath, "info","-f",fspBinFilePath], stdout=subprocess.PIPE)
Output = Process.communicate()[0]
FsptInfo = Output.rsplit(b"FSP_M", 1);
--
2.21.0.windows.1
next reply other threads:[~2019-08-19 7:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-19 7:21 Cheng, Ching JenX [this message]
2019-08-19 8:59 ` [edk2-devel] [PATCH] Python run fail if env variable PYTHON_HOME is not set Chiu, Chasel
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=20190819072128.15400-1-ching.jenx.cheng@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