From: Guido van Rossum Date: Fri, 3 Apr 1998 23:38:59 +0000 (+0000) Subject: This was the reason a numeric array to a real power was not working. X-Git-Tag: v1.5.1~200 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f7d590c93da411e635ff5cad4f697fb64a4833b7;p=thirdparty%2FPython%2Fcpython.git This was the reason a numeric array to a real power was not working. --- diff --git a/Objects/abstract.c b/Objects/abstract.c index 82eec95a828a..0835fe30b4e2 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -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");