[pypy-svn] r12050 - pypy/dist/pypy/objspace/std
arigo at codespeak.net
arigo at codespeak.net
Sat May 7 01:54:13 CEST 2005
Author: arigo
Date: Sat May 7 01:54:13 2005
New Revision: 12050
Modified:
pypy/dist/pypy/objspace/std/stringobject.py
Log:
Ugh. On 64-bit machines:
>>> [2] * 1111111111111
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ValueError: sequence repeat count too large
>>> [2] * 11111111111111111111111111
Traceback (most recent call last):
File "<stdin>", line 1, in ?
OverflowError: long int too large to convert to int
Modified: pypy/dist/pypy/objspace/std/stringobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/stringobject.py (original)
+++ pypy/dist/pypy/objspace/std/stringobject.py Sat May 7 01:54:13 2005
@@ -898,7 +898,9 @@
input_len = len(input)
try:
buffer = [' '] * ovfcheck(mul*input_len)
- except (MemoryError,OverflowError):
+ except (MemoryError,OverflowError,ValueError):
+ # ugh. ValueError is what you get on 64-bit machines for
+ # integers in range(2**31, 2**63).
raise OperationError( space.w_OverflowError, space.wrap("repeated string is too long: %d %d" % (input_len,mul) ))
pos = 0
More information about the Pypy-commit
mailing list