summaryrefslogtreecommitdiff
path: root/Modules/cmathmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/cmathmodule.c')
-rw-r--r--Modules/cmathmodule.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/cmathmodule.c b/Modules/cmathmodule.c
index d12e4c50cd..7f6c2c9df4 100644
--- a/Modules/cmathmodule.c
+++ b/Modules/cmathmodule.c
@@ -986,9 +986,10 @@ cmath_polar_impl(PyModuleDef *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; otherwise 0 */
+ r = _Py_c_abs(z); /* sets errno to ERANGE on overflow */
PyFPE_END_PROTECT(r)
if (errno != 0)
return math_error();