mirror of
https://github.com/python/cpython.git
synced 2025-09-22 16:33:26 +00:00
fix bogus test for negative float
This commit is contained in:
parent
6a75d26622
commit
8a1e8eb62f
1 changed files with 3 additions and 3 deletions
|
@ -920,8 +920,8 @@ do_pow(v, w)
|
||||||
err_setstr(TypeError, "pow() requires numeric arguments");
|
err_setstr(TypeError, "pow() requires numeric arguments");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if ((w->ob_type==&Floattype) &&
|
if (is_floatobject(w) && getfloatvalue(v) < 0.0) {
|
||||||
(*v->ob_type->tp_as_number->nb_negative)(v)) {
|
if (!err_occurred())
|
||||||
err_setstr(ValueError, "negative number to float power");
|
err_setstr(ValueError, "negative number to float power");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue