summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWill Woods <wwoods@redhat.com>2008-08-25 13:50:45 -0400
committerWill Woods <wwoods@redhat.com>2008-08-25 13:50:45 -0400
commitb96496b875f3561099b94f644792686b9ec95885 (patch)
tree9b7b1a7d1e763e0cf37e0300ace0861288c409c0
parentdcbd893cbc7b4104545fcfc1e49fe9f72ed407c4 (diff)
downloadpython-bugzilla-b96496b875f3561099b94f644792686b9ec95885.zip
python-bugzilla-b96496b875f3561099b94f644792686b9ec95885.tar.gz
python-bugzilla-b96496b875f3561099b94f644792686b9ec95885.tar.xz
Handle ^C a little more cleanly
-rwxr-xr-xbin/bugzilla9
1 files changed, 8 insertions, 1 deletions
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)