diff options
author | Carsey, Jaben </o=Intel/ou=Americas01/cn=Workers/cn=Carsey, Jaben> | 2018-03-27 04:25:43 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2018-03-30 08:25:13 +0800 |
commit | 4231a8193ec0d52df7e0a101d96c51b1a2b7a996 (patch) | |
tree | 4fc8e46c9d51a4938e891e6b029781f1b66537ae /BaseTools/Source/Python/Ecc/Xml/XmlRoutines.py | |
parent | 05a32984ab799a564e2eeb7dff128fe0992910d8 (diff) | |
download | edk2-4231a8193ec0d52df7e0a101d96c51b1a2b7a996.tar.gz edk2-4231a8193ec0d52df7e0a101d96c51b1a2b7a996.tar.bz2 edk2-4231a8193ec0d52df7e0a101d96c51b1a2b7a996.zip |
BaseTools: Remove equality operator with None
replace "== None" with "is None" and "!= None" with "is not None"
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/Ecc/Xml/XmlRoutines.py')
-rw-r--r-- | BaseTools/Source/Python/Ecc/Xml/XmlRoutines.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/BaseTools/Source/Python/Ecc/Xml/XmlRoutines.py b/BaseTools/Source/Python/Ecc/Xml/XmlRoutines.py index b93588eea6..a86f19624c 100644 --- a/BaseTools/Source/Python/Ecc/Xml/XmlRoutines.py +++ b/BaseTools/Source/Python/Ecc/Xml/XmlRoutines.py @@ -30,14 +30,14 @@ from Common.LongFilePathSupport import OpenLongFilePath as open def CreateXmlElement(Name, String, NodeList, AttributeList):
Doc = xml.dom.minidom.Document()
Element = Doc.createElement(Name)
- if String != '' and String != None:
+ if String != '' and String is not None:
Element.appendChild(Doc.createTextNode(String))
for Item in NodeList:
if type(Item) == type([]):
Key = Item[0]
Value = Item[1]
- if Key != '' and Key != None and Value != '' and Value != None:
+ if Key != '' and Key is not None and Value != '' and Value is not None:
Node = Doc.createElement(Key)
Node.appendChild(Doc.createTextNode(Value))
Element.appendChild(Node)
@@ -46,7 +46,7 @@ def CreateXmlElement(Name, String, NodeList, AttributeList): for Item in AttributeList:
Key = Item[0]
Value = Item[1]
- if Key != '' and Key != None and Value != '' and Value != None:
+ if Key != '' and Key is not None and Value != '' and Value is not None:
Element.setAttribute(Key, Value)
return Element
@@ -62,7 +62,7 @@ def CreateXmlElement(Name, String, NodeList, AttributeList): # @revel Nodes A list of XML nodes matching XPath style Sting.
#
def XmlList(Dom, String):
- if String == None or String == "" or Dom == None or Dom == "":
+ if String is None or String == "" or Dom is None or Dom == "":
return []
if Dom.nodeType == Dom.DOCUMENT_NODE:
Dom = Dom.documentElement
@@ -98,7 +98,7 @@ def XmlList(Dom, String): # @revel Node A single XML node matching XPath style Sting.
#
def XmlNode(Dom, String):
- if String == None or String == "" or Dom == None or Dom == "":
+ if String is None or String == "" or Dom is None or Dom == "":
return ""
if Dom.nodeType == Dom.DOCUMENT_NODE:
Dom = Dom.documentElement
|