Bug report
floatobject contains this code:
|
#define SetIntFlag(flag) \ |
|
PyStructSequence_SET_ITEM(floatinfo, pos++, PyLong_FromLong(flag)) |
|
#define SetDblFlag(flag) \ |
|
PyStructSequence_SET_ITEM(floatinfo, pos++, PyFloat_FromDouble(flag)) |
|
|
|
SetDblFlag(DBL_MAX); |
|
SetIntFlag(DBL_MAX_EXP); |
|
SetIntFlag(DBL_MAX_10_EXP); |
|
SetDblFlag(DBL_MIN); |
|
SetIntFlag(DBL_MIN_EXP); |
|
SetIntFlag(DBL_MIN_10_EXP); |
|
SetIntFlag(DBL_DIG); |
|
SetIntFlag(DBL_MANT_DIG); |
|
SetDblFlag(DBL_EPSILON); |
|
SetIntFlag(FLT_RADIX); |
|
SetIntFlag(FLT_ROUNDS); |
|
#undef SetIntFlag |
|
#undef SetDblFlag |
|
|
|
if (PyErr_Occurred()) { |
|
Py_CLEAR(floatinfo); |
|
return NULL; |
|
} |
It only shows the last error and swallows any others.
I propose to change the error handling with the smallest possible diff.
Linked PRs
Bug report
floatobjectcontains this code:cpython/Objects/floatobject.c
Lines 101 to 123 in ba82a24
It only shows the last error and swallows any others.
I propose to change the error handling with the smallest possible diff.
Linked PRs
PyFloat_GetInfo#116715PyFloat_GetInfo(GH-116715) #116722PyFloat_GetInfo(GH-116715) #116723