File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 4
4
#include <sys/un.h>
5
5
#include "Python.h"
6
6
#include "uv.h"
7
+ #include <signal.h>
7
8
8
9
9
10
#ifndef EWOULDBLOCK
@@ -83,3 +84,22 @@ int Context_Exit(PyObject *ctx) {
83
84
}
84
85
85
86
#endif
87
+
88
+ /* inlined from cpython/Modules/signalmodule.c
89
+ * https://github.com/python/cpython/blob/v3.13.0a6/Modules/signalmodule.c#L1931-L1951
90
+ * private _Py_RestoreSignals has been moved to CPython internals in Python 3.13
91
+ * https://github.com/python/cpython/pull/106400 */
92
+
93
+ void
94
+ _Py_RestoreSignals (void )
95
+ {
96
+ #ifdef SIGPIPE
97
+ PyOS_setsig (SIGPIPE , SIG_DFL );
98
+ #endif
99
+ #ifdef SIGXFZ
100
+ PyOS_setsig (SIGXFZ , SIG_DFL );
101
+ #endif
102
+ #ifdef SIGXFSZ
103
+ PyOS_setsig (SIGXFSZ , SIG_DFL );
104
+ #endif
105
+ }
Original file line number Diff line number Diff line change @@ -11,8 +11,6 @@ cdef extern from "Python.h":
11
11
object PyUnicode_EncodeFSDefault(object )
12
12
void PyErr_SetInterrupt() nogil
13
13
14
- void _Py_RestoreSignals()
15
-
16
14
object PyMemoryView_FromMemory(char * mem, ssize_t size, int flags)
17
15
object PyMemoryView_FromObject(object obj)
18
16
int PyMemoryView_Check(object obj)
@@ -29,3 +27,5 @@ cdef extern from "includes/compat.h":
29
27
void PyOS_BeforeFork()
30
28
void PyOS_AfterFork_Parent()
31
29
void PyOS_AfterFork_Child()
30
+
31
+ void _Py_RestoreSignals()
You can’t perform that action at this time.
0 commit comments