From 2bb69a5b4e7f96cb35d1b28aa7b7b3974b351f59 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Sun, 10 Sep 2017 23:50:46 -0700 Subject: bpo-31373: remove overly strict float range checks (#3486) This undoes a853a8ba7850381d49b284295dd6f0dc491dbe44 except for the pytime.c parts. We want to continue to allow IEEE 754 doubles larger than FLT_MAX to be rounded into finite floats. Tests were added to very this behavior. --- Python/getargs.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'Python/getargs.c') diff --git a/Python/getargs.c b/Python/getargs.c index 0b155a170f..dd7ca9fed1 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -859,10 +859,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; -- cgit v1.2.1