File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -362,6 +362,7 @@ Peter Schneider-Kamp
362362Sam Schulenburg
363363Dietmar Schwertberger
364364Barry Scott
365+ Steven Scott
365366Nick Seidenman
366367Fred Sells
367368Denis Severson
Original file line number Diff line number Diff line change 3131
3232Windows
3333
34+ - The signal module now supports SIGBREAK on Windows, thanks to Steven
35+ Scott. Note that SIGBREAK is unique to Windows. The default SIGBREAK
36+ action remains to call Win32 ExitProcess(). This can be changed via
37+ signal.signal(). For example:
38+
39+ # Make Ctrl+Break raise KeyboardInterrupt, like Python's default Ctrl+C
40+ # (SIGINT) behavior.
41+ import signal
42+ signal.signal(signal.SIGBREAK,
43+ signal.default_int_handler)
44+
45+ try:
46+ while 1:
47+ pass
48+ except KeyboardInterrupt:
49+ # We get here on Ctrl+C or Ctrl+Break now; if we had not changed
50+ # SIGBREAK, only on Ctrl+C (and Ctrl+Break would terminate the
51+ # program without the possibility for any Python-level cleanup).
52+ print "Clean exit"
53+
3454
3555What's New in Python 2.2a4?
3656Release date: 28-Sep-2001
Original file line number Diff line number Diff line change @@ -383,6 +383,11 @@ initsignal(void)
383383 PyDict_SetItemString (d , "SIGINT" , x );
384384 Py_XDECREF (x );
385385#endif
386+ #ifdef SIGBREAK
387+ x = PyInt_FromLong (SIGBREAK );
388+ PyDict_SetItemString (d , "SIGBREAK" , x );
389+ Py_XDECREF (x );
390+ #endif
386391#ifdef SIGQUIT
387392 x = PyInt_FromLong (SIGQUIT );
388393 PyDict_SetItemString (d , "SIGQUIT" , x );
You can’t perform that action at this time.
0 commit comments