diff --git a/Lib/test/test_float.py b/Lib/test/test_float.py index 6491f458c3a..c5ca50c8f71 100644 --- a/Lib/test/test_float.py +++ b/Lib/test/test_float.py @@ -613,6 +613,12 @@ class IEEEFormatTestCase(unittest.TestCase): (' FLT_MAX && !Py_IS_INFINITY(x)) + if (Py_IS_INFINITY(y) && !Py_IS_INFINITY(x)) goto Overflow; unsigned char s[sizeof(float)]; - float y = (float)x; memcpy(s, &y, sizeof(float)); if ((float_format == ieee_little_endian_format && !le) diff --git a/Python/getargs.c b/Python/getargs.c index 8fb19f34ecb..13819642060 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -811,10 +811,6 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags, double dval = PyFloat_AsDouble(arg); if (PyErr_Occurred()) RETURN_ERR_OCCURRED; - else if (dval > FLT_MAX) - *p = (float)INFINITY; - else if (dval < -FLT_MAX) - *p = (float)-INFINITY; else *p = (float) dval; break;