Kaydet (Commit) 8a1e8eb6 authored tarafından Guido van Rossum's avatar Guido van Rossum

fix bogus test for negative float

üst 6a75d266
...@@ -920,9 +920,9 @@ do_pow(v, w) ...@@ -920,9 +920,9 @@ 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;
} }
if (coerce(&v, &w) != 0) if (coerce(&v, &w) != 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment