From 70b531fee9a0bb791330e0629ef41ba23706dc40 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Mon, 2 Aug 2010 10:04:22 +0200 Subject: [PATCH] [molecule] catch KeyboardInterrupt by running kill phase in while loop --- molecule.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/molecule.py b/molecule.py index 03103de..be42a39 100644 --- a/molecule.py +++ b/molecule.py @@ -53,11 +53,15 @@ for el in molecule_data_order: try: rc = my.run() except KeyboardInterrupt: + while True: + my.kill() + kill_pids() + break + raise SystemExit(1) + while True: my.kill() kill_pids() - raise SystemExit(1) - my.kill() - kill_pids() + break if rc != 0: raise SystemExit(rc) raise SystemExit(0)