This was the reason a numeric array to a real power was not working.

This commit is contained in:
Guido van Rossum 1998-04-03 23:38:59 +00:00
parent 88c6bdf042
commit f7d590c93d

View file

@ -463,7 +463,8 @@ do_pow(v, w)
"pow() requires numeric arguments");
return NULL;
}
if (PyFloat_Check(w) && PyFloat_AsDouble(v) < 0.0) {
if (PyFloat_Check(v) && PyFloat_Check(w) &&
PyFloat_AsDouble(v) < 0.0) {
if (!PyErr_Occurred())
PyErr_SetString(PyExc_ValueError,
"negative number to float power");