summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/AutoGen/UniClassObject.py
diff options
context:
space:
mode:
authorFeng, Bob C <bob.c.feng@intel.com>2019-09-04 13:00:37 +0800
committerFeng, Bob C <bob.c.feng@intel.com>2019-09-17 10:19:05 +0800
commit0075ab2cec500fc679c6b2e4990142b4a2e51050 (patch)
treedd5fe19ef82620090e1733e9f7e3322bdf9e1f15 /BaseTools/Source/Python/AutoGen/UniClassObject.py
parentbc9e4194cf3edaf9524c83098ba3f72008c70190 (diff)
downloadedk2-0075ab2cec500fc679c6b2e4990142b4a2e51050.tar.gz
edk2-0075ab2cec500fc679c6b2e4990142b4a2e51050.tar.bz2
edk2-0075ab2cec500fc679c6b2e4990142b4a2e51050.zip
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>
Diffstat (limited to 'BaseTools/Source/Python/AutoGen/UniClassObject.py')
-rw-r--r--BaseTools/Source/Python/AutoGen/UniClassObject.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/BaseTools/Source/Python/AutoGen/UniClassObject.py b/BaseTools/Source/Python/AutoGen/UniClassObject.py
index 9f6a271566..b2895f7e5c 100644
--- a/BaseTools/Source/Python/AutoGen/UniClassObject.py
+++ b/BaseTools/Source/Python/AutoGen/UniClassObject.py
@@ -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);