summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/UPT
diff options
context:
space:
mode:
authorHess Chen <hesheng.chen@intel.com>2016-08-08 11:28:20 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2016-08-09 14:39:56 +0800
commit9e730bd16418d76e400f87cf852b53f960d1d5b3 (patch)
tree5480851abea7732fb602c2f533e69fac9ce92c8b /BaseTools/Source/Python/UPT
parent7989300df75f274203d74266811089aaa11b517c (diff)
downloadedk2-9e730bd16418d76e400f87cf852b53f960d1d5b3.tar.gz
edk2-9e730bd16418d76e400f87cf852b53f960d1d5b3.tar.bz2
edk2-9e730bd16418d76e400f87cf852b53f960d1d5b3.zip
BaseTools/UPT: Fix a install issue
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: Hess Chen <hesheng.chen@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/UPT')
-rw-r--r--BaseTools/Source/Python/UPT/Library/String.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/BaseTools/Source/Python/UPT/Library/String.py b/BaseTools/Source/Python/UPT/Library/String.py
index 05b5fb17da..89371dbdbf 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'):