summaryrefslogtreecommitdiffstats
path: root/Modules/signalmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-05-10 15:13:00 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-05-10 15:13:00 (GMT)
commit388196ed72fbac61eea511eefb36f8f94634a8b4 (patch)
tree63e4d35fb69562e044124873bf83c0d3f743ee9c /Modules/signalmodule.c
parent3c6e4dd11fa2c3d43f94a6d5c6e2af221ac5cf99 (diff)
downloadcpython-388196ed72fbac61eea511eefb36f8f94634a8b4.zip
cpython-388196ed72fbac61eea511eefb36f8f94634a8b4.tar.gz
cpython-388196ed72fbac61eea511eefb36f8f94634a8b4.tar.bz2
Issue #12011: signal.signal() and signal.siginterrupt() raise an OSError,
instead of a RuntimeError: OSError has an errno attribute.
Diffstat (limited to 'Modules/signalmodule.c')
-rw-r--r--Modules/signalmodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
index e504669..feeae5e 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;
}