]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Treat Ecc.py as a python module
authorGary Lin <glin@suse.com>
Fri, 13 Jul 2018 10:18:41 +0000 (18:18 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Mon, 16 Jul 2018 03:22:16 +0000 (11:22 +0800)
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>
BaseTools/BinWrappers/PosixLike/Ecc
BaseTools/BinWrappers/WindowsLike/Ecc.bat

index 01ae23ddeb4f8845ce89ec4656d12ef43bf6a58b..bca1bae96af7c625a74d0dbfd6498233a64c3e71 100755 (executable)
@@ -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 "$@"\r
index 9fbb704a6eb00baca50f39f0cc3fa6b9d30525f3..98095cfbd4390c89f17ce74d486951933f2e8dc4 100644 (file)
@@ -1,3 +1,4 @@
 @setlocal\r
 @set ToolName=%~n0%\r
-@%PYTHON_HOME%\python.exe %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %*\r
+@set PYTHONPATH=%PYTHONPATH%;%BASE_TOOLS_PATH%\Source\Python\r
+@%PYTHON_HOME%\python.exe -m %ToolName%.%ToolName% %*\r