fix bogus test for negative float

This commit is contained in:
Guido van Rossum 1995-02-18 14:51:32 +00:00
parent 6a75d26622
commit 8a1e8eb62f
1 changed files with 3 additions and 3 deletions

View File

@ -920,9 +920,9 @@ do_pow(v, w)
err_setstr(TypeError, "pow() requires numeric arguments");
return NULL;
}
if ((w->ob_type==&Floattype) &&
(*v->ob_type->tp_as_number->nb_negative)(v)) {
err_setstr(ValueError, "negative number to float power");
if (is_floatobject(w) && getfloatvalue(v) < 0.0) {
if (!err_occurred())
err_setstr(ValueError, "negative number to float power");
return NULL;
}
if (coerce(&v, &w) != 0)