mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-04 02:30:24 +01:00
examples: avoid "x == None" checks in python examples
lgmt.com says "Testing for None should use the is operator".
This commit is contained in:
parent
c7d0a86050
commit
8ad448444a
2 changed files with 2 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue