diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2019-05-22 14:08:01 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2019-05-22 14:08:01 -0300 |
commit | e8e977182995073fcf1ce96c94a9c5c99fa98b2d (patch) | |
tree | a1527ca93fdfc44c6dc307b0f093f8332d4d4f6c | |
parent | a14879914a682d1daee6e9f16b0bc00c3e28d686 (diff) | |
download | ckandumper-e8e977182995073fcf1ce96c94a9c5c99fa98b2d.tar.gz ckandumper-e8e977182995073fcf1ce96c94a9c5c99fa98b2d.tar.bz2 |
Filter exceptions with a single statement
-rwxr-xr-x | ckandumper | 8 |
1 files changed, 1 insertions, 7 deletions
@@ -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) |