From: Daniel P. Berrangé Date: Fri, 25 Jan 2019 11:18:55 +0000 (+0000) Subject: hyperv: use "is None" not "== None" for PEP-8 compliance X-Git-Tag: v5.1.0-rc1~305 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c618e17d16580342019b67ce51a9244b1f3444d;p=thirdparty%2Flibvirt.git hyperv: use "is None" not "== None" for PEP-8 compliance 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 Signed-off-by: Daniel P. Berrangé --- diff --git a/src/hyperv/hyperv_wmi_generator.py b/src/hyperv/hyperv_wmi_generator.py index fc1370955f..a9ece0ff00 100755 --- a/src/hyperv/hyperv_wmi_generator.py +++ b/src/hyperv/hyperv_wmi_generator.py @@ -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)