diff options
author | Thomas Haller <thaller@redhat.com> | 2020-05-06 23:42:13 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2020-05-07 13:58:15 +0200 |
commit | 8ad448444a14cbb421e89509da9c2a5d30eb4004 (patch) | |
tree | 4af555afc50a6ee2d21867338a867a2658a457f4 /examples | |
parent | c7d0a8605067a7b86a36bc2ce5470d0367a4d737 (diff) | |
download | NetworkManager-8ad448444a14cbb421e89509da9c2a5d30eb4004.tar.gz |
examples: avoid "x == None" checks in python examples
lgmt.com says "Testing for None should use the is operator".
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/python/dbus/checkpoint.py | 2 | ||||
-rwxr-xr-x | examples/python/gi/deactivate-all.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/examples/python/dbus/checkpoint.py b/examples/python/dbus/checkpoint.py index 62c7573b8c..1ea1b1a7fc 100755 --- a/examples/python/dbus/checkpoint.py +++ b/examples/python/dbus/checkpoint.py @@ -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) diff --git a/examples/python/gi/deactivate-all.py b/examples/python/gi/deactivate-all.py index 3af350e4c3..7e528d0b3e 100755 --- a/examples/python/gi/deactivate-all.py +++ b/examples/python/gi/deactivate-all.py @@ -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) |