]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
hyperv: use "is None" not "== None" for PEP-8 compliance
authorDaniel P. Berrangé <berrange@redhat.com>
Fri, 25 Jan 2019 11:18:55 +0000 (11:18 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Thu, 31 Jan 2019 10:38:43 +0000 (10:38 +0000)
PEP 8 says:

    "Comparisons to singletons like None should always be done
     with 'is' or 'is not', never the equality operators."

There are potentially semantics differences, though in the case of this
libvirt code its merely a style change:

  http://jaredgrubb.blogspot.com/2009/04/python-is-none-vs-none.html

Reviewed-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/hyperv/hyperv_wmi_generator.py

index fc1370955f9834154d1ef0eeca20be388afa5d1b..a9ece0ff00dac06edc39c1bae71415de99c8ee79 100755 (executable)
@@ -65,7 +65,7 @@ class WmiClass:
         # because we'll generate "common" member and will be the "base" name
         if len(self.versions) > 1:
             first = self.versions[0]
-            if first.version == None:
+            if first.version is None:
                 first.version = "v1"
             first.name = "%s_%s" % (first.name, first.version)