mirror of
https://gitlab.com/libvirt/libvirt-python.git
synced 2025-12-13 00:23:49 +03:00
examples/dhcp*: Fix None comparison
None should be compared with "is None" instead of "== None", as the later would invoke a "__cmp__()" method. Signed-off-by: Philipp Hahn <hahn@univention.de>
This commit is contained in:
committed by
Philipp Hahn
parent
6aa02b3292
commit
a19f086831
@@ -35,7 +35,7 @@ except libvirt.libvirtError:
|
||||
sys.exit(0)
|
||||
|
||||
leases = net.DHCPLeases()
|
||||
if (leases == None):
|
||||
if not leases:
|
||||
print("Failed to get leases for %s" % net.name())
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user