File tree Expand file tree Collapse file tree 2 files changed +44
-1
lines changed Expand file tree Collapse file tree 2 files changed +44
-1
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,26 @@ PyGrammar_AddAccelerators(g)
68
68
#endif
69
69
}
70
70
71
+ void
72
+ PyGrammar_RemoveAccelerators (g )
73
+ grammar * g ;
74
+ {
75
+ dfa * d ;
76
+ int i ;
77
+ g -> g_accel = 0 ;
78
+ d = g -> g_dfa ;
79
+ for (i = g -> g_ndfas ; -- i >= 0 ; d ++ ) {
80
+ state * s ;
81
+ int j ;
82
+ s = d -> d_state ;
83
+ for (j = 0 ; j < d -> d_nstates ; j ++ , s ++ ) {
84
+ if (s -> s_accel )
85
+ PyMem_DEL (s -> s_accel );
86
+ s -> s_accel = NULL ;
87
+ }
88
+ }
89
+ }
90
+
71
91
static void
72
92
fixdfa (g , d )
73
93
grammar * g ;
Original file line number Diff line number Diff line change @@ -49,6 +49,11 @@ PyOS_InitInterrupts()
49
49
{
50
50
}
51
51
52
+ void
53
+ PyOS_FiniInterrupts ()
54
+ {
55
+ }
56
+
52
57
int
53
58
PyOS_InterruptOccurred ()
54
59
{
@@ -81,6 +86,11 @@ PyOS_InitInterrupts()
81
86
_go32_want_ctrl_break (1 /* TRUE */ );
82
87
}
83
88
89
+ void
90
+ PyOS_FiniInterrupts ()
91
+ {
92
+ }
93
+
84
94
int
85
95
PyOS_InterruptOccurred ()
86
96
{
@@ -96,6 +106,11 @@ PyOS_InitInterrupts()
96
106
{
97
107
}
98
108
109
+ void
110
+ PyOS_FiniInterrupts ()
111
+ {
112
+ }
113
+
99
114
int
100
115
PyOS_InterruptOccurred ()
101
116
{
@@ -170,10 +185,12 @@ intcatcher(sig)
170
185
Py_AddPendingCall (PyErr_CheckSignals , NULL );
171
186
}
172
187
188
+ static RETSIGTYPE (* old_siginthandler )() = SIG_DFL ;
189
+
173
190
void
174
191
PyOS_InitInterrupts ()
175
192
{
176
- if (signal (SIGINT , SIG_IGN ) != SIG_IGN )
193
+ if (( old_siginthandler = signal (SIGINT , SIG_IGN ) ) != SIG_IGN )
177
194
signal (SIGINT , intcatcher );
178
195
#ifdef HAVE_SIGINTERRUPT
179
196
/* This is for SunOS and other modern BSD derivatives.
@@ -186,6 +203,12 @@ PyOS_InitInterrupts()
186
203
#endif /* HAVE_SIGINTERRUPT */
187
204
}
188
205
206
+ void
207
+ PyOS_FiniInterrupts ()
208
+ {
209
+ signal (SIGINT , old_siginthandler );
210
+ }
211
+
189
212
int
190
213
PyOS_InterruptOccurred ()
191
214
{
You can’t perform that action at this time.
0 commit comments