summaryrefslogtreecommitdiff
path: root/Modules/signalmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/signalmodule.c')
-rw-r--r--Modules/signalmodule.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
index 14297709c5..00a83b497c 100644
--- a/Modules/signalmodule.c
+++ b/Modules/signalmodule.c
@@ -4,7 +4,6 @@
/* XXX Signals should be recorded per thread, now we have thread state. */
#include "Python.h"
-#include "intrcheck.h"
#ifdef MS_WINDOWS
#include <Windows.h>
@@ -13,9 +12,12 @@
#endif
#endif
+#ifdef HAVE_SIGNAL_H
#include <signal.h>
-
+#endif
+#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
+#endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
@@ -841,6 +843,18 @@ PyInit_signal(void)
PyDict_SetItemString(d, "ItimerError", ItimerError);
#endif
+#ifdef CTRL_C_EVENT
+ x = PyLong_FromLong(CTRL_C_EVENT);
+ PyDict_SetItemString(d, "CTRL_C_EVENT", x);
+ Py_DECREF(x);
+#endif
+
+#ifdef CTRL_BREAK_EVENT
+ x = PyLong_FromLong(CTRL_BREAK_EVENT);
+ PyDict_SetItemString(d, "CTRL_BREAK_EVENT", x);
+ Py_DECREF(x);
+#endif
+
if (PyErr_Occurred()) {
Py_DECREF(m);
m = NULL;
@@ -948,7 +962,7 @@ PyOS_InitInterrupts(void)
{
PyObject *m = PyInit_signal();
if (m) {
- _PyImport_FixupExtension(m, "signal", "signal");
+ _PyImport_FixupBuiltin(m, "signal");
Py_DECREF(m);
}
}
@@ -977,6 +991,7 @@ void
PyOS_AfterFork(void)
{
#ifdef WITH_THREAD
+ _PyGILState_Reinit();
PyEval_ReInitThreads();
main_thread = PyThread_get_thread_ident();
main_pid = getpid();