1994-06-03 15:58:29 +00:00
|
|
|
/***********************************************************
|
1995-01-04 19:12:13 +00:00
|
|
|
Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
|
|
|
|
The Netherlands.
|
1994-06-03 15:58:29 +00:00
|
|
|
|
|
|
|
All Rights Reserved
|
|
|
|
|
1996-10-25 14:44:06 +00:00
|
|
|
Permission to use, copy, modify, and distribute this software and its
|
|
|
|
documentation for any purpose and without fee is hereby granted,
|
1994-06-03 15:58:29 +00:00
|
|
|
provided that the above copyright notice appear in all copies and that
|
1996-10-25 14:44:06 +00:00
|
|
|
both that copyright notice and this permission notice appear in
|
1994-06-03 15:58:29 +00:00
|
|
|
supporting documentation, and that the names of Stichting Mathematisch
|
1996-10-25 14:44:06 +00:00
|
|
|
Centrum or CWI or Corporation for National Research Initiatives or
|
|
|
|
CNRI not be used in advertising or publicity pertaining to
|
|
|
|
distribution of the software without specific, written prior
|
|
|
|
permission.
|
|
|
|
|
|
|
|
While CWI is the initial source for this software, a modified version
|
|
|
|
is made available by the Corporation for National Research Initiatives
|
|
|
|
(CNRI) at the Internet address ftp://ftp.python.org.
|
|
|
|
|
|
|
|
STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
|
|
|
|
REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
|
|
|
|
CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
|
|
|
|
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
|
|
|
PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
|
|
|
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
|
PERFORMANCE OF THIS SOFTWARE.
|
1994-06-03 15:58:29 +00:00
|
|
|
|
|
|
|
******************************************************************/
|
|
|
|
|
|
|
|
/* Sigcheck is similar to intrcheck() but sets an exception when an
|
|
|
|
interrupt occurs. It can't be in the intrcheck.c file since that
|
|
|
|
file (and the whole directory it is in) doesn't know about objects
|
|
|
|
or exceptions. It can't be in errors.c because it can be
|
|
|
|
overridden (at link time) by a more powerful version implemented in
|
|
|
|
signalmodule.c. */
|
|
|
|
|
1997-04-29 20:08:16 +00:00
|
|
|
#include "Python.h"
|
1994-06-03 15:58:29 +00:00
|
|
|
|
|
|
|
/* ARGSUSED */
|
|
|
|
int
|
1997-04-29 20:08:16 +00:00
|
|
|
PyErr_CheckSignals()
|
1994-06-03 15:58:29 +00:00
|
|
|
{
|
1997-04-29 20:08:16 +00:00
|
|
|
if (!PyOS_InterruptOccurred())
|
1994-06-03 15:58:29 +00:00
|
|
|
return 0;
|
1997-04-29 20:08:16 +00:00
|
|
|
PyErr_SetNone(PyExc_KeyboardInterrupt);
|
1994-06-03 15:58:29 +00:00
|
|
|
return -1;
|
|
|
|
}
|