]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/UPT/Library/Xml/XmlRoutines.py
BaseTools: Remove equality operator with None
[mirror_edk2.git] / BaseTools / Source / Python / UPT / Library / Xml / XmlRoutines.py
index d7614b884990248fd52cbf5e67f9fefbdf447425..f20ae4dfa82f24acba91f1f3de06c899aa358aea 100644 (file)
@@ -36,14 +36,14 @@ import Logger.Log as Logger
 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
@@ -52,7 +52,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
@@ -66,7 +66,7 @@ def CreateXmlElement(Name, String, NodeList, AttributeList):
 # @param  String             A XPath style path.\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
@@ -101,7 +101,7 @@ def XmlList(Dom, String):
 # @param  String             A XPath style path.\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 None\r
     if Dom.nodeType == Dom.DOCUMENT_NODE:\r
         Dom = Dom.documentElement\r