view Python/sigcheck.c @ 60188:aab64283d00a legacy-trunk

Fix test_compiler.py that was using unittest.__file__ to find Lib/ (unittest is now a package).
author Ezio Melotti <ezio.melotti@gmail.com>
date Fri, 02 Apr 2010 21:43:10 +0000
parents 6f6f965c5e2d
children
line wrap: on
line source


/* 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. */

#include "Python.h"

/* ARGSUSED */
int
PyErr_CheckSignals(void)
{
	if (!PyOS_InterruptOccurred())
		return 0;
	PyErr_SetNone(PyExc_KeyboardInterrupt);
	return -1;
}