From de7123df792a0bba7ad0b92460c0a06a40578775 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 19 Sep 2011 14:38:52 +0200 Subject: [PATCH] always catch KeyboardInterrupt Signed-off-by: Nico Schottelius --- bin/cdist | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bin/cdist b/bin/cdist index a5383524..5ce947ef 100755 --- a/bin/cdist +++ b/bin/cdist @@ -772,13 +772,13 @@ def commandline(): logging.root.setLevel(logging.DEBUG) log.debug(args) - try: - args.func(args) - except KeyboardInterrupt: - sys.exit(0) + args.func(args) if __name__ == "__main__": - if re.match(TYPE_PREFIX, os.path.basename(sys.argv[0])): - emulator() - else: - commandline() + try: + if re.match(TYPE_PREFIX, os.path.basename(sys.argv[0])): + emulator() + else: + commandline() + except KeyboardInterrupt: + sys.exit(0)