Kaydet (Commit) 388196ed authored tarafından Victor Stinner's avatar Victor Stinner

Issue #12011: signal.signal() and signal.siginterrupt() raise an OSError,

instead of a RuntimeError: OSError has an errno attribute.
üst 3c6e4dd1
...@@ -148,6 +148,9 @@ signal ...@@ -148,6 +148,9 @@ signal
a nul byte into the wakeup file descriptor. So it is possible to wait more a nul byte into the wakeup file descriptor. So it is possible to wait more
than one signal and know which signals were raised. than one signal and know which signals were raised.
* :func:`signal.signal` and :func:`signal.siginterrupt` raise an OSError,
instead of a RuntimeError: OSError has an errno attribute.
Optimizations Optimizations
============= =============
......
...@@ -143,6 +143,9 @@ Core and Builtins ...@@ -143,6 +143,9 @@ Core and Builtins
Library Library
------- -------
- Issue #12011: signal.signal() and signal.siginterrupt() raise an OSError,
instead of a RuntimeError: OSError has an errno attribute.
- Issue #3709: a flush_headers method to BaseHTTPRequestHandler which manages - Issue #3709: a flush_headers method to BaseHTTPRequestHandler which manages
the sending of headers to output stream and flushing the internal headers the sending of headers to output stream and flushing the internal headers
buffer. Patch contribution by Andrew Schaaf buffer. Patch contribution by Andrew Schaaf
......
...@@ -324,7 +324,7 @@ signal_signal(PyObject *self, PyObject *args) ...@@ -324,7 +324,7 @@ signal_signal(PyObject *self, PyObject *args)
else else
func = signal_handler; func = signal_handler;
if (PyOS_setsig(sig_num, func) == SIG_ERR) { if (PyOS_setsig(sig_num, func) == SIG_ERR) {
PyErr_SetFromErrno(PyExc_RuntimeError); PyErr_SetFromErrno(PyExc_OSError);
return NULL; return NULL;
} }
old_handler = Handlers[sig_num].func; old_handler = Handlers[sig_num].func;
...@@ -393,7 +393,7 @@ signal_siginterrupt(PyObject *self, PyObject *args) ...@@ -393,7 +393,7 @@ signal_siginterrupt(PyObject *self, PyObject *args)
return NULL; return NULL;
} }
if (siginterrupt(sig_num, flag)<0) { if (siginterrupt(sig_num, flag)<0) {
PyErr_SetFromErrno(PyExc_RuntimeError); PyErr_SetFromErrno(PyExc_OSError);
return NULL; return NULL;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment