summaryrefslogtreecommitdiffstats
path: root/Modules/cmathmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/cmathmodule.c')
-rw-r--r--Modules/cmathmodule.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/cmathmodule.c b/Modules/cmathmodule.c
index 7e9de1f..438f010 100644
--- a/Modules/cmathmodule.c
+++ b/Modules/cmathmodule.c
@@ -247,7 +247,9 @@ math_1(args, func)
if (!PyArg_ParseTuple(args, "D", &x))
return NULL;
errno = 0;
+ PyFPE_START_PROTECT("complex function", return 0)
x = (*func)(x);
+ PyFPE_END_PROTECT
CHECK(x.real);
CHECK(x.imag);
if (errno != 0)