PageRenderTime 18ms CodeModel.GetById 14ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/Python/sigcheck.c

http://unladen-swallow.googlecode.com/
C | 19 lines | 9 code | 3 blank | 7 comment | 1 complexity | 66d32a096a3ae08040476c1a8cd1097c MD5 | raw file
 1
 2/* Sigcheck is similar to intrcheck() but sets an exception when an
 3   interrupt occurs.  It can't be in the intrcheck.c file since that
 4   file (and the whole directory it is in) doesn't know about objects
 5   or exceptions.  It can't be in errors.c because it can be
 6   overridden (at link time) by a more powerful version implemented in
 7   signalmodule.c. */
 8
 9#include "Python.h"
10
11/* ARGSUSED */
12int
13PyErr_CheckSignals(void)
14{
15	if (!PyOS_InterruptOccurred())
16		return 0;
17	PyErr_SetNone(PyExc_KeyboardInterrupt);
18	return -1;
19}