BaseTools: Treat Ecc.py as a python module

Since Ecc.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>
This commit is contained in:
Gary Lin 2018-07-13 18:18:41 +08:00 committed by Yonghong Zhu
parent f3fc5b47ad
commit e52b39ab8e
2 changed files with 3 additions and 2 deletions

View File

@ -11,4 +11,4 @@ dir=$(dirname "$full_cmd")
cmd=${full_cmd##*/} cmd=${full_cmd##*/}
export PYTHONPATH="$dir/../../Source/Python${PYTHONPATH:+:"$PYTHONPATH"}" export PYTHONPATH="$dir/../../Source/Python${PYTHONPATH:+:"$PYTHONPATH"}"
exec "${python_exe:-python}" "$dir/../../Source/Python/$cmd/$cmd.py" "$@" exec "${python_exe:-python}" -m $cmd.$cmd "$@"

View File

@ -1,3 +1,4 @@
@setlocal @setlocal
@set ToolName=%~n0% @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% %*