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>
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 @@
# 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'):