diff options
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/abstract.c | 3 |
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"); |