You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
529 B

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