mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-02-07 15:03:34 +00:00
d26d7ae0e4
Building o//third_party/python now takes 5 seconds on my PC This change works towards modifying Python to use runtime dispatching when appropriate. For example, when loading the magnums in the socket module, it's a good idea to check if the magnum is zero, because that means the local system platform doesn't support it.
21 lines
611 B
C
21 lines
611 B
C
#include "third_party/python/Include/Python.h"
|
|
/* clang-format off */
|
|
|
|
/* 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. */
|
|
|
|
#pragma weak PyErr_CheckSignals
|
|
|
|
/* ARGSUSED */
|
|
int
|
|
PyErr_CheckSignals(void)
|
|
{
|
|
if (!PyOS_InterruptOccurred())
|
|
return 0;
|
|
PyErr_SetNone(PyExc_KeyboardInterrupt);
|
|
return -1;
|
|
}
|