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>
This commit is contained in:
Hess Chen
2016-08-08 11:28:20 +08:00
committed by Yonghong Zhu
parent 7989300df7
commit 9e730bd164

View File

@ -962,7 +962,12 @@ def IsMatchArch(Arch1, Arch2):
# Return the FileName with index +1 under the FilePath # Return the FileName with index +1 under the FilePath
# #
def GetUniFileName(FilePath, FileName): def GetUniFileName(FilePath, FileName):
Files = []
try:
Files = os.listdir(FilePath) Files = os.listdir(FilePath)
except:
pass
LargestIndex = -1 LargestIndex = -1
for File in Files: for File in Files:
if File.upper().startswith(FileName.upper()) and File.upper().endswith('.UNI'): if File.upper().startswith(FileName.upper()) and File.upper().endswith('.UNI'):