Пример #1
0
static PyObject *turnon_sigfpe(PyObject *self,PyObject *args)
{
    /* Do any architecture-specific one-time only initialization here. */

    fpe_reset(sigfpe_handler);
    Py_RETURN_NONE;
}
Пример #2
0
static PyObject *turnon_sigfpe(PyObject *self,PyObject *args)
{
    /* Do any architecture-specific one-time only initialization here. */

    fpe_reset(sigfpe_handler);
    Py_INCREF (Py_None);
    return Py_None;
}
Пример #3
0
static void sigfpe_handler(int signo)
{
    fpe_reset(sigfpe_handler);
    if(PyFPE_counter) {
        longjmp(PyFPE_jbuf, 1);
    } else {
        Py_FatalError("Unprotected floating point exception");
    }
}