mirror of https://github.com/python/cpython
Fix #10003. Add SIGBREAK to the set of valid signals on Windows.
This fixes a regression noticed by bzr, introduced by issue #9324.
This commit is contained in:
parent
38e2996152
commit
9e88b5aeee
|
@ -212,13 +212,13 @@ class BasicSignalTests(unittest.TestCase):
|
||||||
@unittest.skipUnless(sys.platform == "win32", "Windows specific")
|
@unittest.skipUnless(sys.platform == "win32", "Windows specific")
|
||||||
class WindowsSignalTests(unittest.TestCase):
|
class WindowsSignalTests(unittest.TestCase):
|
||||||
def test_issue9324(self):
|
def test_issue9324(self):
|
||||||
|
# Updated for issue #10003, adding SIGBREAK
|
||||||
handler = lambda x, y: None
|
handler = lambda x, y: None
|
||||||
signal.signal(signal.SIGABRT, handler)
|
for sig in (signal.SIGABRT, signal.SIGBREAK, signal.SIGFPE,
|
||||||
signal.signal(signal.SIGFPE, handler)
|
signal.SIGILL, signal.SIGINT, signal.SIGSEGV,
|
||||||
signal.signal(signal.SIGILL, handler)
|
signal.SIGTERM):
|
||||||
signal.signal(signal.SIGINT, handler)
|
# Set and then reset a handler for signals that work on windows
|
||||||
signal.signal(signal.SIGSEGV, handler)
|
signal.signal(sig, signal.signal(sig, handler))
|
||||||
signal.signal(signal.SIGTERM, handler)
|
|
||||||
|
|
||||||
with self.assertRaises(ValueError):
|
with self.assertRaises(ValueError):
|
||||||
signal.signal(-1, handler)
|
signal.signal(-1, handler)
|
||||||
|
|
|
@ -10,6 +10,9 @@ What's New in Python 3.2 Alpha 3?
|
||||||
Core and Builtins
|
Core and Builtins
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
- Issue #10003: Allow handling of SIGBREAK on Windows. Fixes a regression
|
||||||
|
introduced by issue #9324.
|
||||||
|
|
||||||
- Issue #9979: Create function PyUnicode_AsWideCharString().
|
- Issue #9979: Create function PyUnicode_AsWideCharString().
|
||||||
|
|
||||||
- Issue #7397: Mention that importlib.import_module() is probably what someone
|
- Issue #7397: Mention that importlib.import_module() is probably what someone
|
||||||
|
|
|
@ -261,6 +261,11 @@ signal_signal(PyObject *self, PyObject *args)
|
||||||
/* Validate that sig_num is one of the allowable signals */
|
/* Validate that sig_num is one of the allowable signals */
|
||||||
switch (sig_num) {
|
switch (sig_num) {
|
||||||
case SIGABRT: break;
|
case SIGABRT: break;
|
||||||
|
#ifdef SIGBREAK
|
||||||
|
/* Issue #10003: SIGBREAK is not documented as permitted, but works
|
||||||
|
and corresponds to CTRL_BREAK_EVENT. */
|
||||||
|
case SIGBREAK: break;
|
||||||
|
#endif
|
||||||
case SIGFPE: break;
|
case SIGFPE: break;
|
||||||
case SIGILL: break;
|
case SIGILL: break;
|
||||||
case SIGINT: break;
|
case SIGINT: break;
|
||||||
|
|
Loading…
Reference in New Issue