BaseTools: Add error handling for current_dir is not exist

Add the error handling to cover the case that current_dir is not exist.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Yonghong Zhu 2016-06-03 09:29:06 +08:00
parent b34e446122
commit 570ae1ebc8
1 changed files with 5 additions and 4 deletions

View File

@ -597,10 +597,11 @@ cleanlib:
while not found and os.sep in package_rel_dir:
index = package_rel_dir.index(os.sep)
current_dir = mws.join(current_dir, package_rel_dir[:index])
for fl in os.listdir(current_dir):
if fl.endswith('.dec'):
found = True
break
if os.path.exists(current_dir):
for fl in os.listdir(current_dir):
if fl.endswith('.dec'):
found = True
break
package_rel_dir = package_rel_dir[index + 1:]
MakefileTemplateDict = {