summaryrefslogtreecommitdiffstats
path: root/BaseTools/BinWrappers
diff options
context:
space:
mode:
authorGary Lin <glin@suse.com>2018-07-13 18:18:32 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2018-07-16 11:22:12 +0800
commit15e20228258c1714cd90207a52101a5b1b54cd2c (patch)
treed3920360bc3d1b24179ad79758a5738c472862d6 /BaseTools/BinWrappers
parent543f5ac30facfbb40eafb2b4908649a427784080 (diff)
downloadedk2-15e20228258c1714cd90207a52101a5b1b54cd2c.tar.gz
edk2-15e20228258c1714cd90207a52101a5b1b54cd2c.tar.bz2
edk2-15e20228258c1714cd90207a52101a5b1b54cd2c.zip
BaseTools: Treat GenFds.py as a python module
Since GenFds.py import modules from its own directory, add "-m" to the python parameters so that they can import its own modules after adopting absolute import. Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Gary Lin <glin@suse.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Diffstat (limited to 'BaseTools/BinWrappers')
-rwxr-xr-xBaseTools/BinWrappers/PosixLike/GenFds2
-rw-r--r--BaseTools/BinWrappers/WindowsLike/GenFds.bat3
2 files changed, 3 insertions, 2 deletions
diff --git a/BaseTools/BinWrappers/PosixLike/GenFds b/BaseTools/BinWrappers/PosixLike/GenFds
index 01ae23ddeb..bca1bae96a 100755
--- a/BaseTools/BinWrappers/PosixLike/GenFds
+++ b/BaseTools/BinWrappers/PosixLike/GenFds
@@ -11,4 +11,4 @@ dir=$(dirname "$full_cmd")
cmd=${full_cmd##*/}
export PYTHONPATH="$dir/../../Source/Python${PYTHONPATH:+:"$PYTHONPATH"}"
-exec "${python_exe:-python}" "$dir/../../Source/Python/$cmd/$cmd.py" "$@"
+exec "${python_exe:-python}" -m $cmd.$cmd "$@"
diff --git a/BaseTools/BinWrappers/WindowsLike/GenFds.bat b/BaseTools/BinWrappers/WindowsLike/GenFds.bat
index 9fbb704a6e..98095cfbd4 100644
--- a/BaseTools/BinWrappers/WindowsLike/GenFds.bat
+++ b/BaseTools/BinWrappers/WindowsLike/GenFds.bat
@@ -1,3 +1,4 @@
@setlocal
@set ToolName=%~n0%
-@%PYTHON_HOME%\python.exe %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %*
+@set PYTHONPATH=%PYTHONPATH%;%BASE_TOOLS_PATH%\Source\Python
+@%PYTHON_HOME%\python.exe -m %ToolName%.%ToolName% %*