From e7393b789ad830cf1215ece89099657221861ffd Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Sat, 21 Nov 2009 23:44:05 +0100 Subject: [PATCH] [molecule] do not print traceback when CTRL+C is pressed --- molecule.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/molecule.py b/molecule.py index 21efd17..af19be1 100644 --- a/molecule.py +++ b/molecule.py @@ -31,8 +31,12 @@ if not molecule_data_order: for el in molecule_data_order: my = Runner(el, molecule_data.get(el)) - rc = my.run() + try: + rc = my.run() + except KeyboardInterrupt: + my.kill() + raise SystemExit(1) my.kill() if rc != 0: raise SystemExit(rc) -raise SystemExit(0) \ No newline at end of file +raise SystemExit(0)