mirror of
https://github.com/python/cpython.git
synced 2024-11-24 18:34:43 +08:00
Whoops. errno should only be tested when the result is finite.
This commit is contained in:
parent
a0de26c342
commit
de4296281a
@ -188,11 +188,11 @@ math_1_to_whatever(PyObject *arg, double (*func) (double),
|
||||
"math domain error (singularity)");
|
||||
return NULL;
|
||||
}
|
||||
/* on most machines, errno should be 0 at this point */
|
||||
if (errno && is_error(r))
|
||||
if (Py_IS_FINITE(r) && errno && is_error(r))
|
||||
/* this branch unnecessary on most platforms */
|
||||
return NULL;
|
||||
else
|
||||
return (*from_double_func)(r);
|
||||
|
||||
return (*from_double_func)(r);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user