From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: bob.c.feng@intel.com) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by groups.io with SMTP; Thu, 09 May 2019 00:00:35 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 May 2019 00:00:35 -0700 X-ExtLoop1: 1 Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga007.fm.intel.com with ESMTP; 09 May 2019 00:00:35 -0700 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 9 May 2019 00:00:35 -0700 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 9 May 2019 00:00:34 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.129]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.7]) with mapi id 14.03.0415.000; Thu, 9 May 2019 15:00:33 +0800 From: "Bob Feng" To: "Fan, ZhijuX" , "devel@edk2.groups.io" CC: "Gao, Liming" Subject: Re: [PATCH] Revert "BaseTools:code of test python module is moved to edksetup" Thread-Topic: [PATCH] Revert "BaseTools:code of test python module is moved to edksetup" Thread-Index: AdUGM22nSTbMj2bGTfWz/E0ak0QcsQAAWgSw Date: Thu, 9 May 2019 07:00:32 +0000 Message-ID: <08650203BA1BD64D8AD9B6D5D74A85D160109598@SHSMSX101.ccr.corp.intel.com> References: In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: bob.c.feng@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Bob Feng =20 -----Original Message----- From: Fan, ZhijuX=20 Sent: Thursday, May 9, 2019 2:50 PM To: devel@edk2.groups.io Cc: Gao, Liming ; Feng, Bob C Subject: [PATCH] Revert "BaseTools:code of test python module is moved to e= dksetup" This reverts commit df7c81b5b219c9aee776baa466dd64c9d318dd80. In commint df7c81b5b219c9,used a function to test python module But the Boo= lean value of the return value of this function is the opposite of the Corr= ect result, resulting in an unexpected result Cc: Bob Feng Cc: Liming Gao Signed-off-by: Zhiju.Fan --- BaseTools/Tests/RunTests.py | 8 ++++++++ edksetup.sh | 15 ++------------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/BaseTools/Tests/RunTests.py b/BaseTools/Tests/RunTests.py inde= x e8acf1b348..81af736cd8 100644 --- a/BaseTools/Tests/RunTests.py +++ b/BaseTools/Tests/RunTests.py @@ -12,6 +12,14 @@ import os import sys import unittest + +try: + import distutils.util +except ModuleNotFoundError: + sys.exit(''' +Python reported: "No module named 'distutils.util" +''') + import TestTools =20 def GetCTestSuite(): diff --git a/edksetup.sh b/edksetup.sh index ed9ceae85d..c7b2e1e201 100755 --- a/edksetup.sh +++ b/edksetup.sh @@ -177,22 +177,11 @@ function SetupPython() SetupPython3 } =20 -function TestUtilModule() -{ - if ( $PYTHON_COMMAND -c "import distutils.util" >/dev/null 2>&1 );then - return 1 - else - echo Error: "No module named 'distutils.util" - return 0 - fi -} - function SourceEnv() { SetWorkspace && - SetupEnv && - SetupPython && - TestUtilModule + SetupEnv + SetupPython } =20 I=3D$# -- 2.14.1.windows.1