summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-05-06 23:42:13 +0200
committerThomas Haller <thaller@redhat.com>2020-05-07 13:58:15 +0200
commit8ad448444a14cbb421e89509da9c2a5d30eb4004 (patch)
tree4af555afc50a6ee2d21867338a867a2658a457f4 /examples
parentc7d0a8605067a7b86a36bc2ce5470d0367a4d737 (diff)
downloadNetworkManager-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-xexamples/python/dbus/checkpoint.py2
-rwxr-xr-xexamples/python/gi/deactivate-all.py2
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)