Ctrl-C handler, how to override?
Aldo Cortesi
aldo at nullcube.com
Wed Oct 2 20:02:52 EDT 2002
More information about the Python-list mailing list
Wed Oct 2 20:02:52 EDT 2002
- Previous message (by thread): Ctrl-C handler, how to override?
- Next message (by thread): Ctrl-C handler, how to override?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Thus spake Bruce Edge (edgebruce at yahoo.com): > How the @#$!$ do override the SIGINT handler? > > I can create handlers for other signals, but not for SIGINT: > > >>> getsignal(SIGINT) > <built-in function default_int_handler> > >>> def handler(signum, frame): > ... print "got signal", signum > >>> signal(SIGINT, handler) > 1 > >>> getsignal(SIGINT) > <function handler at 0x81466f4> > > ...Looks OK so far, but Ctrl-C's still call the default handler: > > >>> > KeyboardInterrupt > >>> > KeyboardInterrupt > http://mail.python.org/mailman/listinfo/python-list Bruce, What you're seeing is a side-effect of running your code in the interactive interpreter. Your code works fine when run from a file. Cheers, Aldo -- Aldo Cortesi aldo at nullcube.com http://www.nullcube.com
- Previous message (by thread): Ctrl-C handler, how to override?
- Next message (by thread): Ctrl-C handler, how to override?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list