From 2165158ab32bf1808478cb0199df45d8be1ec2f4 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 10 Feb 1995 16:57:16 +0000 Subject: test for float to the float power here --- Python/bltinmodule.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 551d009..83eeecb 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -916,6 +916,11 @@ 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"); + return NULL; + } if (coerce(&v, &w) != 0) return NULL; res = (*v->ob_type->tp_as_number->nb_power)(v, w, None); -- cgit v0.12