]> granicus.if.org Git - python/commitdiff
Arrange for PyErr_CheckSignals() to be called via Py_AddPendingCall().
authorGuido van Rossum <guido@python.org>
Tue, 21 Jan 1997 06:13:09 +0000 (06:13 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 21 Jan 1997 06:13:09 +0000 (06:13 +0000)
This avoids having to call sigcheck() (the same routine by its old
name :-) in the ticker code in ceval.c's main interpreter loop.

Modules/signalmodule.c

index f15c62a3c0ccb4f73e24f9d2b6354d9d5e3d0b78..e6d3f19fda6fdd04c90083e4a0065058b75ebde4 100644 (file)
@@ -115,6 +115,7 @@ signal_handler(sig_num)
 #endif
                is_tripped++;
                Handlers[sig_num].tripped = 1;
+               Py_AddPendingCall((int (*) Py_PROTO((ANY *)))PyErr_CheckSignals, NULL);
 #ifdef WITH_THREAD
        }
 #endif
@@ -523,7 +524,7 @@ PyErr_CheckSignals()
                                Py_DECREF(arglist);
                        }
                        if (!result)
-                               return 1;
+                               return -1;
 
                        Py_DECREF(result);
                }
@@ -541,6 +542,7 @@ PyErr_SetInterrupt()
 {
        is_tripped++;
        Handlers[SIGINT].tripped = 1;
+       Py_AddPendingCall((int (*) Py_PROTO((ANY *)))PyErr_CheckSignals, NULL);
 }
 
 void