Author: Philip Jenvey <[email protected]>
Branch: py3k
Changeset: r67272:1a9a32b0a81d
Date: 2013-10-09 16:21 -0700
http://bitbucket.org/pypy/pypy/changeset/1a9a32b0a81d/
Log: reapply py3k's behavior
diff --git a/pypy/objspace/std/floatobject.py b/pypy/objspace/std/floatobject.py
--- a/pypy/objspace/std/floatobject.py
+++ b/pypy/objspace/std/floatobject.py
@@ -401,9 +401,10 @@
try:
result = _pow(space, x, y)
except PowDomainError:
- raise operationerrfmt(space.w_ValueError,
- "negative number cannot be raised to a "
- "fractional power")
+ # Negative numbers raised to fractional powers become complex
+ return space.pow(space.newcomplex(x, 0.0),
+ space.newcomplex(y, 0.0),
+ thirdArg)
return W_FloatObject(result)
class PowDomainError(ValueError):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit