[pypy-svn] r39726 - in pypy/branch/rope-branch/pypy/objspace/std: . test

cfbolz at codespeak.net cfbolz at codespeak.net
Fri Mar 2 17:59:01 CET 2007


Author: cfbolz
Date: Fri Mar  2 17:58:59 2007
New Revision: 39726

Modified:
   pypy/branch/rope-branch/pypy/objspace/std/ropeobject.py
   pypy/branch/rope-branch/pypy/objspace/std/test/test_ropeobject.py
Log:
fix a bug, thanks armin for spotting


Modified: pypy/branch/rope-branch/pypy/objspace/std/ropeobject.py
==============================================================================
--- pypy/branch/rope-branch/pypy/objspace/std/ropeobject.py	(original)
+++ pypy/branch/rope-branch/pypy/objspace/std/ropeobject.py	Fri Mar  2 17:58:59 2007
@@ -857,7 +857,7 @@
     except OverflowError:
         raise OperationError(
             space.w_OverflowError, 
-            space.wrap("repeated string is too long: %d %d" % (input_len, mul)))
+            space.wrap("repeated string is too long: %d %d" % (length, mul)))
     return W_RopeObject(rope.multiply(node, mul))
 
 def mul__Rope_ANY(space, w_str, w_times):

Modified: pypy/branch/rope-branch/pypy/objspace/std/test/test_ropeobject.py
==============================================================================
--- pypy/branch/rope-branch/pypy/objspace/std/test/test_ropeobject.py	(original)
+++ pypy/branch/rope-branch/pypy/objspace/std/test/test_ropeobject.py	Fri Mar  2 17:58:59 2007
@@ -8,6 +8,10 @@
     def setup_class(cls):
         cls.space = gettestobjspace(**{"objspace.std.withrope": True})
 
+    def test_mul_overflow(self):
+        import sys
+        raises(OverflowError, '"abcdefg" * (sys.maxint // 2)')
+
 class AppTestRopeUnicode(object):
 
     def setup_class(cls):



More information about the Pypy-commit mailing list