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

@ -371,13 +371,12 @@ class UniFileClassObject(object):
# Pre-process before parse .uni file
#
def PreProcess(self, File):
if not os.path.exists(File.Path) or not os.path.isfile(File.Path):
EdkLogger.error("Unicode File Parser", FILE_NOT_FOUND, ExtraData=File.Path)
try:
FileIn = UniFileClassObject.OpenUniFile(LongFilePath(File.Path))
except UnicodeError as X:
EdkLogger.error("build", FILE_READ_FAILURE, "File read failure: %s" % str(X), ExtraData=File.Path);
except OSError:
EdkLogger.error("Unicode File Parser", FILE_NOT_FOUND, ExtraData=File.Path)
except:
EdkLogger.error("build", FILE_OPEN_FAILURE, ExtraData=File.Path);