summaryrefslogtreecommitdiffstats
path: root/Modules/cmathmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/cmathmodule.c')
-rw-r--r--Modules/cmathmodule.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/Modules/cmathmodule.c b/Modules/cmathmodule.c
index 02c09bb..8b21dec 100644
--- a/Modules/cmathmodule.c
+++ b/Modules/cmathmodule.c
@@ -17,7 +17,7 @@ module cmath
/*[python input]
class Py_complex_protected_converter(Py_complex_converter):
def modify(self):
- return 'errno = 0; PyFPE_START_PROTECT("complex function", goto exit);'
+ return 'errno = 0;'
class Py_complex_protected_return_converter(CReturnConverter):
@@ -26,7 +26,6 @@ class Py_complex_protected_return_converter(CReturnConverter):
def render(self, function, data):
self.declare(data)
data.return_conversion.append("""
-PyFPE_END_PROTECT(_return_value);
if (errno == EDOM) {
PyErr_SetString(PyExc_ValueError, "math domain error");
goto exit;
@@ -40,7 +39,7 @@ else {
}
""".strip())
[python start generated code]*/
-/*[python end generated code: output=da39a3ee5e6b4b0d input=345daa075b1028e7]*/
+/*[python end generated code: output=da39a3ee5e6b4b0d input=8b27adb674c08321]*/
#if (FLT_RADIX != 2 && FLT_RADIX != 16)
#error "Modules/cmathmodule.c expects FLT_RADIX to be 2 or 16"
@@ -960,7 +959,6 @@ cmath_log_impl(PyObject *module, Py_complex x, PyObject *y_obj)
Py_complex y;
errno = 0;
- PyFPE_START_PROTECT("complex function", return 0)
x = c_log(x);
if (y_obj != NULL) {
y = PyComplex_AsCComplex(y_obj);
@@ -970,7 +968,6 @@ cmath_log_impl(PyObject *module, Py_complex x, PyObject *y_obj)
y = c_log(y);
x = _Py_c_quot(x, y);
}
- PyFPE_END_PROTECT(x)
if (errno != 0)
return math_error();
return PyComplex_FromCComplex(x);
@@ -1008,9 +1005,7 @@ cmath_phase_impl(PyObject *module, Py_complex z)
double phi;
errno = 0;
- PyFPE_START_PROTECT("arg function", return 0)
phi = c_atan2(z);
- PyFPE_END_PROTECT(phi)
if (errno != 0)
return math_error();
else
@@ -1035,10 +1030,8 @@ cmath_polar_impl(PyObject *module, Py_complex z)
double r, phi;
errno = 0;
- PyFPE_START_PROTECT("polar function", return 0)
phi = c_atan2(z); /* should not cause any exception */
r = _Py_c_abs(z); /* sets errno to ERANGE on overflow */
- PyFPE_END_PROTECT(r)
if (errno != 0)
return math_error();
else
@@ -1074,7 +1067,6 @@ cmath_rect_impl(PyObject *module, double r, double phi)
{
Py_complex z;
errno = 0;
- PyFPE_START_PROTECT("rect function", return 0)
/* deal with special values */
if (!Py_IS_FINITE(r) || !Py_IS_FINITE(phi)) {
@@ -1116,7 +1108,6 @@ cmath_rect_impl(PyObject *module, double r, double phi)
errno = 0;
}
- PyFPE_END_PROTECT(z)
if (errno != 0)
return math_error();
else