Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bf51afa

Browse files
committed
Don't test here for negative number to float power; that belongs in
floatobject.c.
1 parent 79d96d6 commit bf51afa

1 file changed

Lines changed: 0 additions & 9 deletions

File tree

Python/ceval.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2282,15 +2282,6 @@ powerop(v, w)
22822282
err_setstr(TypeError, "pow() requires numeric arguments");
22832283
return NULL;
22842284
}
2285-
if (
2286-
#ifndef WITHOUT_COMPLEX
2287-
!is_complexobject(v) &&
2288-
#endif
2289-
is_floatobject(w) && getfloatvalue(v) < 0.0) {
2290-
if (!err_occurred())
2291-
err_setstr(ValueError, "negative number to float power");
2292-
return NULL;
2293-
}
22942285
if (coerce(&v, &w) != 0)
22952286
return NULL;
22962287
res = (*v->ob_type->tp_as_number->nb_power)(v, w, None);

0 commit comments

Comments
 (0)