Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a75d26 commit 8a1e8ebCopy full SHA for 8a1e8eb
1 file changed
Python/bltinmodule.c
@@ -920,9 +920,9 @@ do_pow(v, w)
920
err_setstr(TypeError, "pow() requires numeric arguments");
921
return NULL;
922
}
923
- if ((w->ob_type==&Floattype) &&
924
- (*v->ob_type->tp_as_number->nb_negative)(v)) {
925
- 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");
926
927
928
if (coerce(&v, &w) != 0)
0 commit comments