BaseTools: remove unnecessary calls of os.exist

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2101

This patch is going to remove unnecessary calls
of os.exist()

Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Feng, Bob C
2019-09-04 13:00:37 +08:00
parent bc9e4194cf
commit 0075ab2cec
5 changed files with 62 additions and 59 deletions

View File

@ -636,11 +636,13 @@ 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])
if os.path.exists(current_dir):
try:
for fl in os.listdir(current_dir):
if fl.endswith('.dec'):
found = True
break
except:
EdkLogger.error('build', FILE_NOT_FOUND, "WORKSPACE does not exist.")
package_rel_dir = package_rel_dir[index + 1:]
MakefileTemplateDict = {