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)
6868#endif
6969}
7070
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+
7191static void
7292fixdfa (g , d )
7393 grammar * g ;
Original file line number Diff line number Diff line change @@ -49,6 +49,11 @@ PyOS_InitInterrupts()
4949{
5050}
5151
52+ void
53+ PyOS_FiniInterrupts ()
54+ {
55+ }
56+
5257int
5358PyOS_InterruptOccurred ()
5459{
@@ -81,6 +86,11 @@ PyOS_InitInterrupts()
8186 _go32_want_ctrl_break (1 /* TRUE */ );
8287}
8388
89+ void
90+ PyOS_FiniInterrupts ()
91+ {
92+ }
93+
8494int
8595PyOS_InterruptOccurred ()
8696{
@@ -96,6 +106,11 @@ PyOS_InitInterrupts()
96106{
97107}
98108
109+ void
110+ PyOS_FiniInterrupts ()
111+ {
112+ }
113+
99114int
100115PyOS_InterruptOccurred ()
101116{
@@ -170,10 +185,12 @@ intcatcher(sig)
170185 Py_AddPendingCall (PyErr_CheckSignals , NULL );
171186}
172187
188+ static RETSIGTYPE (* old_siginthandler )() = SIG_DFL ;
189+
173190void
174191PyOS_InitInterrupts ()
175192{
176- if (signal (SIGINT , SIG_IGN ) != SIG_IGN )
193+ if (( old_siginthandler = signal (SIGINT , SIG_IGN ) ) != SIG_IGN )
177194 signal (SIGINT , intcatcher );
178195#ifdef HAVE_SIGINTERRUPT
179196 /* This is for SunOS and other modern BSD derivatives.
@@ -186,6 +203,12 @@ PyOS_InitInterrupts()
186203#endif /* HAVE_SIGINTERRUPT */
187204}
188205
206+ void
207+ PyOS_FiniInterrupts ()
208+ {
209+ signal (SIGINT , old_siginthandler );
210+ }
211+
189212int
190213PyOS_InterruptOccurred ()
191214{
You can’t perform that action at this time.
0 commit comments