This commit is contained in:
Luke Rogers 2013-10-30 08:49:43 +13:00
parent ee057bc45a
commit fbb6204f83
3 changed files with 44 additions and 26 deletions

View file

@ -21,8 +21,12 @@ if os.path.exists(os.path.abspath('lib')):
print 'CloudBot2 <http://git.io/cloudbotirc>'
def exit_gracefully(signum, frame):
# this doesn't really work that well
cloudbot.stop()
# restore the original handler so if they do it again it triggers
signal.signal(signal.SIGINT, original_sigint)
# store the original SIGINT handler
original_sigint = signal.getsignal(signal.SIGINT)
signal.signal(signal.SIGINT, exit_gracefully)