From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by ml01.01.org (Postfix) with ESMTP id F10711A1E0F for ; Sun, 7 Aug 2016 20:28:23 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 07 Aug 2016 20:28:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,487,1464678000"; d="scan'208";a="1010188226" Received: from tiano01.ccr.corp.intel.com ([10.239.9.145]) by orsmga001.jf.intel.com with ESMTP; 07 Aug 2016 20:28:22 -0700 From: hesschen To: edk2-devel@lists.01.org Date: Mon, 8 Aug 2016 11:28:20 +0800 Message-Id: <1470626900-610212-1-git-send-email-hesheng.chen@intel.com> X-Mailer: git-send-email 2.7.2.windows.1 Subject: [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 03:28:24 -0000 Fix a corner case issue of installing a module without any files which causes 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/Source/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 GetUniFileName(FilePath, FileName): - Files = os.listdir(FilePath) + Files = [] + try: + Files = os.listdir(FilePath) + except: + pass + LargestIndex = -1 for File in Files: if File.upper().startswith(FileName.upper()) and File.upper().endswith('.UNI'): -- 2.7.2.windows.1