gh-119613: Use C99+ functions instead of Py_IS_NAN/INFINITY/FINITE (#119619)

This commit is contained in:
Sergey B Kirpichev 2024-05-29 10:51:19 +03:00 committed by GitHub
parent 86d1a1aa88
commit cd11ff12ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 140 additions and 142 deletions

View file

@ -375,7 +375,7 @@ pytime_object_to_denominator(PyObject *obj, time_t *sec, long *numerator,
if (PyFloat_Check(obj)) {
double d = PyFloat_AsDouble(obj);
if (Py_IS_NAN(d)) {
if (isnan(d)) {
*numerator = 0;
PyErr_SetString(PyExc_ValueError, "Invalid value NaN (not a number)");
return -1;
@ -403,7 +403,7 @@ _PyTime_ObjectToTime_t(PyObject *obj, time_t *sec, _PyTime_round_t round)
volatile double d;
d = PyFloat_AsDouble(obj);
if (Py_IS_NAN(d)) {
if (isnan(d)) {
PyErr_SetString(PyExc_ValueError, "Invalid value NaN (not a number)");
return -1;
}
@ -590,7 +590,7 @@ pytime_from_object(PyTime_t *tp, PyObject *obj, _PyTime_round_t round,
if (PyFloat_Check(obj)) {
double d;
d = PyFloat_AsDouble(obj);
if (Py_IS_NAN(d)) {
if (isnan(d)) {
PyErr_SetString(PyExc_ValueError, "Invalid value NaN (not a number)");
return -1;
}