]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Ecc/Exception.py
BaseTools: Replace StandardError with Expression
[mirror_edk2.git] / BaseTools / Source / Python / Ecc / Exception.py
index 733408551af19876cf8b9eafad6986475c911e18..bde41c3a4b570931d9b2cc2336b483d1800c5b75 100644 (file)
@@ -1,8 +1,8 @@
 ## @file\r
 # This file is used to parse exception items found by ECC tool\r
 #\r
-# Copyright (c) 2009, Intel Corporation\r
-# All rights reserved. This program and the accompanying materials\r
+# Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>\r
+# This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
 # which accompanies this distribution.  The full text of the license may be found at\r
 # http://opensource.org/licenses/bsd-license.php\r
@@ -14,8 +14,9 @@
 ##\r
 # Import Modules\r
 #\r
-from Common.XmlRoutines import *\r
-import os.path\r
+from __future__ import print_function\r
+from Xml.XmlRoutines import *\r
+import Common.LongFilePathOs as os\r
 \r
 # ExceptionXml to parse Exception Node of XML file\r
 class ExceptionXml(object):\r
@@ -72,7 +73,7 @@ class ExceptionCheck(object):
             self.ExceptionList = self.ExceptionListXml.ToList()\r
     \r
     def IsException(self, ErrorID, KeyWord, FileID=-1):\r
-        if (str(ErrorID), KeyWord) in self.ExceptionList:\r
+        if (str(ErrorID), KeyWord.replace('\r\n', '\n')) in self.ExceptionList:\r
             return True\r
         else:\r
             return False\r
@@ -84,4 +85,4 @@ class ExceptionCheck(object):
 #\r
 if __name__ == '__main__':\r
     El = ExceptionCheck('C:\\Hess\\Project\\BuildTool\\src\\Ecc\\exception.xml')\r
-    print El.ExceptionList\r
+    print(El.ExceptionList)\r