]> granicus.if.org Git - python/commitdiff
This was the reason a numeric array to a real power was not working.
authorGuido van Rossum <guido@python.org>
Fri, 3 Apr 1998 23:38:59 +0000 (23:38 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 3 Apr 1998 23:38:59 +0000 (23:38 +0000)
Objects/abstract.c

index 82eec95a828a73db1c7a4b2dc48ab351c28c6507..0835fe30b4e2b2544c476d6bb03f6f95d7797b8d 100644 (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");