[pypy-svn] r9102 - pypy/dist/pypy/objspace/std
ac at codespeak.net
ac at codespeak.net
Fri Feb 11 10:57:55 CET 2005
Author: ac
Date: Fri Feb 11 10:57:55 2005
New Revision: 9102
Modified:
pypy/dist/pypy/objspace/std/longobject.py
Log:
Quick fix to make pow(int, int, long) work.
Modified: pypy/dist/pypy/objspace/std/longobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/longobject.py (original)
+++ pypy/dist/pypy/objspace/std/longobject.py Fri Feb 11 10:57:55 2005
@@ -183,6 +183,21 @@
space.wrap(e.args[0]))
return W_LongObject(space, t)
+def pow__Int_Int_Long(space, w_int1, w_int2, w_long3):
+ x = w_int1.intval
+ y = w_int2.intval
+ z = w_long3.longval
+
+ try:
+ t = long(pow(x, y, z))
+ except TypeError, e:
+ raise OperationError(space.w_TypeError,
+ space.wrap(e.args[0]))
+ except ValueError, e:
+ raise OperationError(space.w_ValueError,
+ space.wrap(e.args[0]))
+ return W_LongObject(space, t)
+
def neg__Long(space, w_long1):
return W_LongObject(space, -w_long1.longval)
More information about the Pypy-commit
mailing list