examples: avoid "except" for BaseException in examples

lgtm.com flags this as "Except block directly handles BaseException".
This commit is contained in:
Thomas Haller
2020-05-06 23:40:43 +02:00
parent 5c08981356
commit c7d0a86050
2 changed files with 2 additions and 2 deletions

View File

@@ -134,7 +134,7 @@ def do_adjust_rollback_timeout(client):
sys.exit("Missing timeout") sys.exit("Missing timeout")
try: try:
add_timeout = int(sys.argv[3]) add_timeout = int(sys.argv[3])
except: except Exception:
sys.exit("Invalid timeout") sys.exit("Invalid timeout")
path = validate_path(sys.argv[2], client) path = validate_path(sys.argv[2], client)

View File

@@ -442,7 +442,7 @@ if __name__ == '__main__':
secrets = conn.get_secrets(NM.SETTING_WIREGUARD_SETTING_NAME) secrets = conn.get_secrets(NM.SETTING_WIREGUARD_SETTING_NAME)
if secrets: if secrets:
conn.update_secrets(NM.SETTING_WIREGUARD_SETTING_NAME, secrets) conn.update_secrets(NM.SETTING_WIREGUARD_SETTING_NAME, secrets)
except: except Exception:
pass pass
if not argv: if not argv: