[pypy-svn] r63077 - in pypy/trunk/pypy/objspace/std: . test

pedronis at codespeak.net pedronis at codespeak.net
Thu Mar 19 15:46:57 CET 2009


Author: pedronis
Date: Thu Mar 19 15:46:57 2009
New Revision: 63077

Modified:
   pypy/trunk/pypy/objspace/std/test/test_unicodeobject.py
   pypy/trunk/pypy/objspace/std/unicodeobject.py
Log:
(iko, pedronis)

given RPython agreed behavior is not worth trying to hard to separate OverflowErrors from MemoryError conditions in these unicode ops



Modified: pypy/trunk/pypy/objspace/std/test/test_unicodeobject.py
==============================================================================
--- pypy/trunk/pypy/objspace/std/test/test_unicodeobject.py	(original)
+++ pypy/trunk/pypy/objspace/std/test/test_unicodeobject.py	Thu Mar 19 15:46:57 2009
@@ -415,7 +415,7 @@
         import sys
         if sys.maxint > (1 << 32):
             skip("Wrong platform")
-        raises(OverflowError, u't\tt\t'.expandtabs, sys.maxint)
+        raises((OverflowError, MemoryError), u't\tt\t'.expandtabs, sys.maxint)
         
     def test_translate(self):
         assert u'bbbc' == u'abababc'.translate({ord('a'):None})

Modified: pypy/trunk/pypy/objspace/std/unicodeobject.py
==============================================================================
--- pypy/trunk/pypy/objspace/std/unicodeobject.py	(original)
+++ pypy/trunk/pypy/objspace/std/unicodeobject.py	Thu Mar 19 15:46:57 2009
@@ -266,7 +266,7 @@
     try:
         result_size = ovfcheck(length * times)
         result = u''.join([uni] * times)
-    except (OverflowError, MemoryError):
+    except OverflowError:
         raise OperationError(space.w_OverflowError, space.wrap('repeated string is too long'))
     return W_UnicodeObject(result)
 
@@ -850,7 +850,7 @@
             totalsize = ovfcheck(totalsize + pad)
             totalsize = ovfcheck(totalsize + len(nextpart))
             result.append(u' ' * pad)
-        except (OverflowError, MemoryError):
+        except OverflowError:
             raise OperationError(space.w_OverflowError, space.wrap('new string is too long'))
         result.append(nextpart)
         prevsize = 0



More information about the Pypy-commit mailing list