From b96496b875f3561099b94f644792686b9ec95885 Mon Sep 17 00:00:00 2001 From: Will Woods Date: Mon, 25 Aug 2008 13:50:45 -0400 Subject: Handle ^C a little more cleanly --- bin/bugzilla | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/bugzilla b/bin/bugzilla index 835260d..c55efc8 100755 --- a/bin/bugzilla +++ b/bin/bugzilla @@ -175,7 +175,7 @@ def setup_action_parser(action): "tags that match bug fields, e.g.: '%{bug_id}: %{short_desc}'") return p -if __name__ == '__main__': +def main(): # Set up parser for global args parser = setup_parser() # Parse the commandline, woo @@ -424,3 +424,10 @@ if __name__ == '__main__': print "\nBugs listed: ",len(buglist) else: parser.error("opt.output was set to something weird.") + +if __name__ == '__main__': + try: + main() + except KeyboardInterrupt: + print "\ninterrupted." + sys.exit(0) -- cgit