]> gitweb.fluxo.info Git - ckandumper.git/commitdiff
Filter exceptions with a single statement
authorSilvio Rhatto <rhatto@riseup.net>
Wed, 22 May 2019 17:08:01 +0000 (14:08 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Wed, 22 May 2019 17:08:01 +0000 (14:08 -0300)
ckandumper

index c5fb5896f2e7f938ad3e528636b2a0da4b0f11d6..48967becc492f2d32f80eadf8e280b047e351422 100755 (executable)
@@ -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)