From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=195.135.221.5; helo=smtp.nue.novell.com; envelope-from=glin@suse.com; receiver=edk2-devel@lists.01.org Received: from smtp.nue.novell.com (smtp.nue.novell.com [195.135.221.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1518620986ADD for ; Fri, 13 Jul 2018 03:19:21 -0700 (PDT) Received: from localhost.localdomain (unknown.telstraglobal.net [134.159.103.118]) by smtp.nue.novell.com with ESMTP (NOT encrypted); Fri, 13 Jul 2018 12:19:18 +0200 From: Gary Lin To: edk2-devel@lists.01.org Cc: Yonghong Zhu , Liming Gao Date: Fri, 13 Jul 2018 18:18:38 +0800 Message-Id: <20180713101847.7485-8-glin@suse.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180713101847.7485-1-glin@suse.com> References: <20180713101847.7485-1-glin@suse.com> Subject: [PATCH v2 07/16] BaseTools: Treat BPDG.py as a python module X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jul 2018 10:19:22 -0000 Since BPDG.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 Cc: Liming Gao Signed-off-by: Gary Lin --- BaseTools/BinWrappers/PosixLike/BPDG | 2 +- BaseTools/BinWrappers/WindowsLike/BPDG.bat | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/BaseTools/BinWrappers/PosixLike/BPDG b/BaseTools/BinWrappers/PosixLike/BPDG index 01ae23ddeb4f..276c7ea20733 100755 --- a/BaseTools/BinWrappers/PosixLike/BPDG +++ b/BaseTools/BinWrappers/PosixLike/BPDG @@ -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/BPDG.bat b/BaseTools/BinWrappers/WindowsLike/BPDG.bat index 9fbb704a6eb0..98095cfbd439 100644 --- a/BaseTools/BinWrappers/WindowsLike/BPDG.bat +++ b/BaseTools/BinWrappers/WindowsLike/BPDG.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% %* -- 2.18.0