public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: hesschen <hesheng.chen@intel.com>
To: edk2-devel@lists.01.org
Subject: [patch] BaseTools/UPT: Fix a install issue
Date: Mon,  8 Aug 2016 11:28:20 +0800	[thread overview]
Message-ID: <1470626900-610212-1-git-send-email-hesheng.chen@intel.com> (raw)

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 <hesheng.chen@intel.com>
---
 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



             reply	other threads:[~2016-08-08  3:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-08  3:28 hesschen [this message]
2016-08-08  9:02 ` [patch] BaseTools/UPT: Fix a install issue Zhu, Yonghong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1470626900-610212-1-git-send-email-hesheng.chen@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox