summaryrefslogtreecommitdiff
path: root/BaseTools
diff options
context:
space:
mode:
authorYonghong Zhu <yonghong.zhu@intel.com>2016-06-03 09:29:06 +0800
committerHao Wu <hao.a.wu@intel.com>2016-07-13 09:33:44 +0800
commit8421eed79263c03d5485d7d1476a5c37096ae0e9 (patch)
tree5702a8e58d0f3d6ae31eadf42145c204d381c017 /BaseTools
parentbed0b04dd6c72335eb472747d7dda769459db489 (diff)
downloadedk2-platforms-8421eed79263c03d5485d7d1476a5c37096ae0e9.tar.xz
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> (cherry picked from commit 570ae1ebc857d27e73210e034fef0082df17dc29)
Diffstat (limited to 'BaseTools')
-rw-r--r--BaseTools/Source/Python/AutoGen/GenMake.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/Python/AutoGen/GenMake.py
index 475b794fe8..4b2902f473 100644
--- a/BaseTools/Source/Python/AutoGen/GenMake.py
+++ b/BaseTools/Source/Python/AutoGen/GenMake.py
@@ -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 = {