]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Ecc/Xml/XmlRoutines.py
BaseTools: Remove equality operator with None
[mirror_edk2.git] / BaseTools / Source / Python / Ecc / Xml / XmlRoutines.py
index b93588eea61a12c099ee2e57a7a1127bca5b8cd8..a86f19624c445fb4753432d571b7b7571b76d313 100644 (file)
@@ -30,14 +30,14 @@ from Common.LongFilePathSupport import OpenLongFilePath as open
 def CreateXmlElement(Name, String, NodeList, AttributeList):\r
     Doc = xml.dom.minidom.Document()\r
     Element = Doc.createElement(Name)\r
-    if String != '' and String != None:\r
+    if String != '' and String is not None:\r
         Element.appendChild(Doc.createTextNode(String))\r
     \r
     for Item in NodeList:\r
         if type(Item) == type([]):\r
             Key = Item[0]\r
             Value = Item[1]\r
-            if Key != '' and Key != None and Value != '' and Value != None:\r
+            if Key != '' and Key is not None and Value != '' and Value is not None:\r
                 Node = Doc.createElement(Key)\r
                 Node.appendChild(Doc.createTextNode(Value))\r
                 Element.appendChild(Node)\r
@@ -46,7 +46,7 @@ def CreateXmlElement(Name, String, NodeList, AttributeList):
     for Item in AttributeList:\r
         Key = Item[0]\r
         Value = Item[1]\r
-        if Key != '' and Key != None and Value != '' and Value != None:\r
+        if Key != '' and Key is not None and Value != '' and Value is not None:\r
             Element.setAttribute(Key, Value)\r
     \r
     return Element\r
@@ -62,7 +62,7 @@ def CreateXmlElement(Name, String, NodeList, AttributeList):
 # @revel  Nodes              A list of XML nodes matching XPath style Sting.\r
 #\r
 def XmlList(Dom, String):\r
-    if String == None or String == "" or Dom == None or Dom == "":\r
+    if String is None or String == "" or Dom is None or Dom == "":\r
         return []\r
     if Dom.nodeType == Dom.DOCUMENT_NODE:\r
         Dom = Dom.documentElement\r
@@ -98,7 +98,7 @@ def XmlList(Dom, String):
 # @revel  Node               A single XML node matching XPath style Sting.\r
 #\r
 def XmlNode(Dom, String):\r
-    if String == None or String == ""  or Dom == None or Dom == "":\r
+    if String is None or String == ""  or Dom is None or Dom == "":\r
         return ""\r
     if Dom.nodeType == Dom.DOCUMENT_NODE:\r
         Dom = Dom.documentElement\r