Whoops. errno should only be tested when the result is finite.

This commit is contained in:
Mark Dickinson 2008-05-01 00:19:23 +00:00
parent a0de26c342
commit de4296281a
1 changed files with 4 additions and 4 deletions

View File

@ -188,10 +188,10 @@ math_1_to_whatever(PyObject *arg, double (*func) (double),
"math domain error (singularity)"); "math domain error (singularity)");
return NULL; return NULL;
} }
/* on most machines, errno should be 0 at this point */ if (Py_IS_FINITE(r) && errno && is_error(r))
if (errno && is_error(r)) /* this branch unnecessary on most platforms */
return NULL; return NULL;
else
return (*from_double_func)(r); return (*from_double_func)(r);
} }