examples: avoid "x == None" checks in python examples

lgmt.com says "Testing for None should use the is operator".
This commit is contained in:
Thomas Haller
2020-05-06 23:42:13 +02:00
parent c7d0a86050
commit 8ad448444a
2 changed files with 2 additions and 2 deletions

View File

@@ -41,7 +41,7 @@ devList = []
for arg in sys.argv[2:]:
path = GetDevicePath(arg)
if path == None:
if path is None:
raise Exception("NetworkManager knows nothing about %s" % arg)
else:
devList.append(path)

View File

@@ -57,7 +57,7 @@ if __name__ == "__main__":
# deactivate the connections
for ac in connections:
if ctype == None or ctype == ac.get_connection_type():
if ctype is None or ctype == ac.get_connection_type():
sys.stdout.write("Deactivating %s (%s)" % (ac.get_id(), ac.get_uuid()))
try:
client.deactivate_connection(ac, None)