aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2019-05-22 14:08:01 -0300
committerSilvio Rhatto <rhatto@riseup.net>2019-05-22 14:08:01 -0300
commite8e977182995073fcf1ce96c94a9c5c99fa98b2d (patch)
treea1527ca93fdfc44c6dc307b0f093f8332d4d4f6c
parenta14879914a682d1daee6e9f16b0bc00c3e28d686 (diff)
downloadckandumper-e8e977182995073fcf1ce96c94a9c5c99fa98b2d.tar.gz
ckandumper-e8e977182995073fcf1ce96c94a9c5c99fa98b2d.tar.bz2
Filter exceptions with a single statement
-rwxr-xr-xckandumper8
1 files changed, 1 insertions, 7 deletions
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)