From: Silvio Rhatto Date: Wed, 22 May 2019 17:08:01 +0000 (-0300) Subject: Filter exceptions with a single statement X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=e8e977182995073fcf1ce96c94a9c5c99fa98b2d;p=ckandumper.git Filter exceptions with a single statement --- diff --git a/ckandumper b/ckandumper index c5fb589..48967be 100755 --- a/ckandumper +++ b/ckandumper @@ -359,12 +359,6 @@ if __name__ == "__main__": duration = str(datetime.timedelta(seconds=interval)) print(f'Done. Elapsed time: {duration}') - except FileNotFoundError as e: - print(e) - exit(1) - except KeyboardInterrupt as e: - print(e) - exit(1) - except subprocess.CalledProcessError as e: + except (FileNotFoundError, KeyboardInterrupt, subprocess.CalledProcessError) as e: print(e) exit(1)