diff options
author | Claudio Bley <cbley@av-test.de> | 2013-08-22 11:16:03 +0200 |
---|---|---|
committer | Claudio Bley <cbley@av-test.de> | 2013-08-23 08:12:26 +0200 |
commit | d101d3bce8c59583c5713215b6a7fb2f7376a1fc (patch) | |
tree | cbeaa7759899a4295ba7d628920261ff3b76987e /libvirt-override-virStream.py | |
parent | 2d533bde3bad357a070b2703fed7292eb2e2fb55 (diff) | |
download | libvirt-python-d101d3bce8c59583c5713215b6a7fb2f7376a1fc.tar.gz |
Test for object identity when checking for None in Python
Consistently use "is" or "is not" to compare variables to None,
because doing so is preferrable, as per PEP 8
(http://www.python.org/dev/peps/pep-0008/#programming-recommendations):
> Comparisons to singletons like None should always be done with is or
> is not, never the equality operators.
Diffstat (limited to 'libvirt-override-virStream.py')
-rw-r--r-- | libvirt-override-virStream.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libvirt-override-virStream.py b/libvirt-override-virStream.py index b5cec2a..53000da 100644 --- a/libvirt-override-virStream.py +++ b/libvirt-override-virStream.py @@ -5,7 +5,7 @@ except AttributeError: pass - if self._o != None: + if self._o is not None: libvirtmod.virStreamFree(self._o) self._o = None @@ -103,7 +103,7 @@ the request would block, integer -2 is returned. """ ret = libvirtmod.virStreamRecv(self._o, nbytes) - if ret == None: raise libvirtError ('virStreamRecv() failed') + if ret is None: raise libvirtError ('virStreamRecv() failed') return ret def send(self, data): |