mirror of
https://github.com/python/cpython.git
synced 2024-11-28 20:33:54 +08:00
One more attempt to track down Debian/alpha test_math failures:
add diagnostic information in the ValueError message. This change is temporary, and will be reversed after the next run of the Debian/alpha buildbot.
This commit is contained in:
parent
8fb57fc627
commit
73eada3287
@ -167,6 +167,7 @@ math_1_to_whatever(PyObject *arg, double (*func) (double),
|
|||||||
int can_overflow)
|
int can_overflow)
|
||||||
{
|
{
|
||||||
double x, r;
|
double x, r;
|
||||||
|
char err_message[150];
|
||||||
x = PyFloat_AsDouble(arg);
|
x = PyFloat_AsDouble(arg);
|
||||||
if (x == -1.0 && PyErr_Occurred())
|
if (x == -1.0 && PyErr_Occurred())
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -183,9 +184,16 @@ math_1_to_whatever(PyObject *arg, double (*func) (double),
|
|||||||
if (can_overflow)
|
if (can_overflow)
|
||||||
PyErr_SetString(PyExc_OverflowError,
|
PyErr_SetString(PyExc_OverflowError,
|
||||||
"math range error (overflow)");
|
"math range error (overflow)");
|
||||||
else
|
else {
|
||||||
PyErr_SetString(PyExc_ValueError,
|
/* temporary code to include the inputs
|
||||||
"math domain error (singularity)");
|
and outputs to func in the error
|
||||||
|
message */
|
||||||
|
sprintf(err_message,
|
||||||
|
"math domain error (singularity) "
|
||||||
|
"%.17g -> %.17g",
|
||||||
|
x, r);
|
||||||
|
PyErr_SetString(PyExc_ValueError, err_message);
|
||||||
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (Py_IS_FINITE(r) && errno && is_error(r))
|
if (Py_IS_FINITE(r) && errno && is_error(r))
|
||||||
|
Loading…
Reference in New Issue
Block a user