Guido van Rossum | abe173a | 1994-06-03 15:58:29 +0000 | [diff] [blame] | 1 | /*********************************************************** |
Guido van Rossum | fd71b9e | 2000-06-30 23:50:40 +0000 | [diff] [blame] | 2 | Copyright (c) 2000, BeOpen.com. |
| 3 | Copyright (c) 1995-2000, Corporation for National Research Initiatives. |
| 4 | Copyright (c) 1990-1995, Stichting Mathematisch Centrum. |
| 5 | All rights reserved. |
Guido van Rossum | abe173a | 1994-06-03 15:58:29 +0000 | [diff] [blame] | 6 | |
Guido van Rossum | fd71b9e | 2000-06-30 23:50:40 +0000 | [diff] [blame] | 7 | See the file "Misc/COPYRIGHT" for information on usage and |
| 8 | redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
Guido van Rossum | abe173a | 1994-06-03 15:58:29 +0000 | [diff] [blame] | 9 | ******************************************************************/ |
| 10 | |
| 11 | /* Sigcheck is similar to intrcheck() but sets an exception when an |
| 12 | interrupt occurs. It can't be in the intrcheck.c file since that |
| 13 | file (and the whole directory it is in) doesn't know about objects |
| 14 | or exceptions. It can't be in errors.c because it can be |
| 15 | overridden (at link time) by a more powerful version implemented in |
| 16 | signalmodule.c. */ |
| 17 | |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 18 | #include "Python.h" |
Guido van Rossum | abe173a | 1994-06-03 15:58:29 +0000 | [diff] [blame] | 19 | |
| 20 | /* ARGSUSED */ |
| 21 | int |
Thomas Wouters | f70ef4f | 2000-07-22 18:47:25 +0000 | [diff] [blame] | 22 | PyErr_CheckSignals(void) |
Guido van Rossum | abe173a | 1994-06-03 15:58:29 +0000 | [diff] [blame] | 23 | { |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 24 | if (!PyOS_InterruptOccurred()) |
Guido van Rossum | abe173a | 1994-06-03 15:58:29 +0000 | [diff] [blame] | 25 | return 0; |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 26 | PyErr_SetNone(PyExc_KeyboardInterrupt); |
Guido van Rossum | abe173a | 1994-06-03 15:58:29 +0000 | [diff] [blame] | 27 | return -1; |
| 28 | } |