[pypy-svn] r14622 - pypy/dist/pypy/objspace/std
tismer at codespeak.net
tismer at codespeak.net
Wed Jul 13 17:24:37 CEST 2005
Author: tismer
Date: Wed Jul 13 17:24:36 2005
New Revision: 14622
Modified:
pypy/dist/pypy/objspace/std/floattype.py
Log:
added an overflow check to floattype.
Our helpers in strutil.py *should* not
raise Overflow, but if they do (and they did
until I changed them :-) , then we don't want
to crash the interpreter.
Modified: pypy/dist/pypy/objspace/std/floattype.py
==============================================================================
--- pypy/dist/pypy/objspace/std/floattype.py (original)
+++ pypy/dist/pypy/objspace/std/floattype.py Wed Jul 13 17:24:36 2005
@@ -12,6 +12,10 @@
except ParseStringError, e:
raise OperationError(space.w_ValueError,
space.wrap(e.msg))
+ except OverflowError, e:
+ # this should not happen, but if it does, catch it!
+ raise OperationError(space.w_OverflowError,
+ space.wrap(str(e)))
elif space.is_true(space.isinstance(w_value, space.w_unicode)):
from unicodeobject import unicode_to_decimal_w
strvalue = unicode_to_decimal_w(space, w_value)
More information about the Pypy-commit
mailing list