diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-10 17:13:00 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-10 17:13:00 +0200 |
commit | 388196ed72fbac61eea511eefb36f8f94634a8b4 (patch) | |
tree | 63e4d35fb69562e044124873bf83c0d3f743ee9c | |
parent | 3c6e4dd11fa2c3d43f94a6d5c6e2af221ac5cf99 (diff) | |
download | cpython-git-388196ed72fbac61eea511eefb36f8f94634a8b4.tar.gz |
Issue #12011: signal.signal() and signal.siginterrupt() raise an OSError,
instead of a RuntimeError: OSError has an errno attribute.
-rw-r--r-- | Doc/whatsnew/3.3.rst | 3 | ||||
-rw-r--r-- | Misc/NEWS | 3 | ||||
-rw-r--r-- | Modules/signalmodule.c | 4 |
3 files changed, 8 insertions, 2 deletions
diff --git a/Doc/whatsnew/3.3.rst b/Doc/whatsnew/3.3.rst index e657af2472..d4426655d1 100644 --- a/Doc/whatsnew/3.3.rst +++ b/Doc/whatsnew/3.3.rst @@ -148,6 +148,9 @@ signal a nul byte into the wakeup file descriptor. So it is possible to wait more 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 ============= @@ -143,6 +143,9 @@ Core and Builtins 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 the sending of headers to output stream and flushing the internal headers buffer. Patch contribution by Andrew Schaaf diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c index e5046691a6..feeae5e212 100644 --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -324,7 +324,7 @@ signal_signal(PyObject *self, PyObject *args) else func = signal_handler; if (PyOS_setsig(sig_num, func) == SIG_ERR) { - PyErr_SetFromErrno(PyExc_RuntimeError); + PyErr_SetFromErrno(PyExc_OSError); return NULL; } old_handler = Handlers[sig_num].func; @@ -393,7 +393,7 @@ signal_siginterrupt(PyObject *self, PyObject *args) return NULL; } if (siginterrupt(sig_num, flag)<0) { - PyErr_SetFromErrno(PyExc_RuntimeError); + PyErr_SetFromErrno(PyExc_OSError); return NULL; } |