From c7d0a8605067a7b86a36bc2ce5470d0367a4d737 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 6 May 2020 23:40:43 +0200 Subject: examples: avoid "except" for BaseException in examples lgtm.com flags this as "Except block directly handles BaseException". --- examples/python/gi/checkpoint.py | 2 +- examples/python/gi/nm-wg-set | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/python/gi/checkpoint.py b/examples/python/gi/checkpoint.py index b1ecbb8984..a695a64613 100755 --- a/examples/python/gi/checkpoint.py +++ b/examples/python/gi/checkpoint.py @@ -134,7 +134,7 @@ def do_adjust_rollback_timeout(client): sys.exit("Missing timeout") try: add_timeout = int(sys.argv[3]) - except: + except Exception: sys.exit("Invalid timeout") path = validate_path(sys.argv[2], client) diff --git a/examples/python/gi/nm-wg-set b/examples/python/gi/nm-wg-set index 81d86c7c0a..1f5279ee69 100755 --- a/examples/python/gi/nm-wg-set +++ b/examples/python/gi/nm-wg-set @@ -442,7 +442,7 @@ if __name__ == '__main__': secrets = conn.get_secrets(NM.SETTING_WIREGUARD_SETTING_NAME) if secrets: conn.update_secrets(NM.SETTING_WIREGUARD_SETTING_NAME, secrets) - except: + except Exception: pass if not argv: -- cgit v1.2.1