summaryrefslogtreecommitdiffstats
path: root/Objects/abstract.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-04-03 23:38:59 (GMT)
committerGuido van Rossum <guido@python.org>1998-04-03 23:38:59 (GMT)
commitf7d590c93da411e635ff5cad4f697fb64a4833b7 (patch)
treeb51ecb44402eea2141b48e903c8cd5eac89a411e /Objects/abstract.c
parent88c6bdf042623a6fb617ad7771b0f199f7a2eca2 (diff)
downloadcpython-f7d590c93da411e635ff5cad4f697fb64a4833b7.zip
cpython-f7d590c93da411e635ff5cad4f697fb64a4833b7.tar.gz
cpython-f7d590c93da411e635ff5cad4f697fb64a4833b7.tar.bz2
This was the reason a numeric array to a real power was not working.
Diffstat (limited to 'Objects/abstract.c')
-rw-r--r--Objects/abstract.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 82eec95..0835fe3 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");