Bug 1155968 - Change '==' and '!=' to 'is' and 'is not' to comply with PEP8. r=khuey
authorBoris Kudryavtsev <boriskk.work@gmail.com>
Thu, 14 May 2015 19:50:00 +0200
changeset 251146 72c9859de2cb6a02a73ce89f2ee0379c8b490249
parent 251145 441f01e126163565c165ae9a002b8255f71002e0
child 251147 b27206136b3fba9ff2c7fc78b04e10d744472796
push id13833
push userryanvm@gmail.com
push dateThu, 02 Jul 2015 20:00:55 +0000
treeherderfx-team@98101796b275 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs1155968
milestone42.0a1
Bug 1155968 - Change '==' and '!=' to 'is' and 'is not' to comply with PEP8. r=khuey
xpcom/idl-parser/header.py
xpcom/idl-parser/typelib.py
--- a/xpcom/idl-parser/header.py
+++ b/xpcom/idl-parser/header.py
@@ -432,17 +432,17 @@ def write_interface(iface, fd):
     if len(iface.members) == 0:
         fd.write('\\\n  /* no methods! */')
     elif not member.kind in ('attribute', 'method'):
         fd.write('\\')
 
     fd.write(iface_forward % names)
 
     def emitTemplate(forward_infallible, tmpl, tmpl_notxpcom=None):
-        if tmpl_notxpcom == None:
+        if tmpl_notxpcom is None:
             tmpl_notxpcom = tmpl
         for member in iface.members:
             if isinstance(member, xpidl.Attribute):
                 if forward_infallible and member.infallible:
                     fd.write("\\\n  using %s::%s; " % (iface.name, attributeNativeName(member, True)))
                 fd.write(tmpl % {'asNative': attributeAsNative(member, True),
                                  'nativeName': attributeNativeName(member, True),
                                  'paramList': attributeParamNames(member)})
--- a/xpcom/idl-parser/typelib.py
+++ b/xpcom/idl-parser/typelib.py
@@ -57,19 +57,19 @@ def isDipperType(type):
 def build_interface(iface, ifaces):
     def get_type(type, calltype, iid_is=None, size_is=None):
         """ Return the appropriate xpt.Type object for this param """
 
         while isinstance(type, xpidl.Typedef):
             type = type.realtype
 
         if isinstance(type, xpidl.Builtin):
-            if type.name == 'string' and size_is != None:
+            if type.name == 'string' and size_is is not None:
                 return xpt.StringWithSizeType(size_is, size_is)
-            elif type.name == 'wstring' and size_is != None:
+            elif type.name == 'wstring' and size_is is not None:
                 return xpt.WideStringWithSizeType(size_is, size_is)
             else:
                 tag = TypeMap[type.name]
                 isPtr = (tag == xpt.Type.Tags.char_ptr or tag == xpt.Type.Tags.wchar_t_ptr)
                 return xpt.SimpleType(tag,
                                       pointer=isPtr,
                                       reference=False)
 
@@ -95,17 +95,17 @@ def build_interface(iface, ifaces):
         if isinstance(type, xpidl.Native):
             if type.specialtype:
                 # XXXkhuey jsval is marked differently in the typelib and in the headers :-(
                 isPtr = (type.isPtr(calltype) or type.isRef(calltype)) and not type.specialtype == 'jsval'
                 isRef = type.isRef(calltype) and not type.specialtype == 'jsval'
                 return xpt.SimpleType(TypeMap[type.specialtype],
                                       pointer=isPtr,
                                       reference=isRef)
-            elif iid_is != None:
+            elif iid_is is not None:
                 return xpt.InterfaceIsType(iid_is)
             else:
                 # void ptr
                 return xpt.SimpleType(TypeMap['void'],
                                       pointer=True,
                                       reference=False)
 
         raise Exception("Unknown type!")