[pypy-svn] r11730 - pypy/dist/pypy/objspace/std

arigo at codespeak.net arigo at codespeak.net
Sun May 1 22:19:57 CEST 2005


Author: arigo
Date: Sun May  1 22:19:57 2005
New Revision: 11730

Modified:
   pypy/dist/pypy/objspace/std/longobject.py
Log:
More truediv__Long_Long fixes.


Modified: pypy/dist/pypy/objspace/std/longobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/longobject.py	(original)
+++ pypy/dist/pypy/objspace/std/longobject.py	Sun May  1 22:19:57 2005
@@ -256,7 +256,11 @@
     if not y:
         raise OperationError(space.w_ZeroDivisionError,
                              space.wrap("long division"))
-    z = operator.truediv(x, y)
+    try:
+        z = operator.truediv(x, y)
+    except OverflowError:
+        raise OperationError(space.w_OverflowError,
+                             space.wrap("long/long too large for a float"))
     return space.newfloat(float(z))
 
 def floordiv__Long_Long(space, w_long1, w_long2): #YYYYYY



More information about the Pypy-commit mailing list