From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by ml01.01.org (Postfix) with ESMTP id 7AF1E1A1E18 for ; Mon, 8 Aug 2016 02:02:33 -0700 (PDT) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP; 08 Aug 2016 02:02:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,489,1464678000"; d="scan'208";a="152258177" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga004.fm.intel.com with ESMTP; 08 Aug 2016 02:02:32 -0700 Received: from fmsmsx122.amr.corp.intel.com (10.18.125.37) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 8 Aug 2016 02:02:30 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx122.amr.corp.intel.com (10.18.125.37) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 8 Aug 2016 02:02:30 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.181]) by shsmsx102.ccr.corp.intel.com ([169.254.2.147]) with mapi id 14.03.0248.002; Mon, 8 Aug 2016 17:02:28 +0800 From: "Zhu, Yonghong" To: "Chen, Hesheng" , "edk2-devel@lists.01.org" Thread-Topic: [patch] BaseTools/UPT: Fix a install issue Thread-Index: AQHR8ST2k6Z/WbejckKXR2pfq/LnC6A+xKgw Date: Mon, 8 Aug 2016 09:02:28 +0000 Message-ID: References: <1470626900-610212-1-git-send-email-hesheng.chen@intel.com> In-Reply-To: <1470626900-610212-1-git-send-email-hesheng.chen@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [patch] BaseTools/UPT: Fix a install issue X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Aug 2016 09:02:33 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Yonghong Zhu =20 I will push this patch if no more comment from community. Best Regards, Zhu Yonghong -----Original Message----- From: Chen, Hesheng=20 Sent: Monday, August 08, 2016 11:28 AM To: edk2-devel@lists.01.org Cc: Zhu, Yonghong Subject: [patch] BaseTools/UPT: Fix a install issue Fix a corner case issue of installing a module without any files which caus= es installing UNI file failure Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: hesschen --- BaseTools/Source/Python/UPT/Library/String.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/UPT/Library/String.py b/BaseTools/Sour= ce/Python/UPT/Library/String.py index 05b5fb1..89371db 100644 --- a/BaseTools/Source/Python/UPT/Library/String.py +++ b/BaseTools/Source/Python/UPT/Library/String.py @@ -962,7 +962,12 @@ def IsMatchArch(Arch1, Arch2): # Return the FileName with index +1 under the FilePath # def GetUniFileN= ame(FilePath, FileName): - Files =3D os.listdir(FilePath) + Files =3D [] + try: + Files =3D os.listdir(FilePath) + except: + pass + LargestIndex =3D -1 for File in Files: if File.upper().startswith(FileName.upper()) and File.upper().ends= with('.UNI'): -- 2.7.2.windows.1