From f7d590c93da411e635ff5cad4f697fb64a4833b7 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 3 Apr 1998 23:38:59 +0000 Subject: [PATCH] This was the reason a numeric array to a real power was not working. --- Objects/abstract.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Objects/abstract.c b/Objects/abstract.c index 82eec95a82..0835fe30b4 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"); -- 2.50.1