diff options
author | Yonghong Zhu <yonghong.zhu@intel.com> | 2016-06-03 09:29:06 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2016-06-04 21:20:23 +0800 |
commit | 570ae1ebc857d27e73210e034fef0082df17dc29 (patch) | |
tree | a4c12172b4f493ef6b54fa0995623d2b3c19b55e /BaseTools/Source/Python | |
parent | b34e44612246d9bb86251e8b940dd43a3ad64260 (diff) | |
download | edk2-platforms-570ae1ebc857d27e73210e034fef0082df17dc29.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>
Diffstat (limited to 'BaseTools/Source/Python')
-rw-r--r-- | BaseTools/Source/Python/AutoGen/GenMake.py | 9 |
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 = {
|