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

ac at codespeak.net ac at codespeak.net
Mon May 30 14:52:16 CEST 2005


Author: ac
Date: Mon May 30 14:52:16 2005
New Revision: 12883

Modified:
   pypy/dist/pypy/objspace/std/inttype.py
Log:
Only guard the operation that can generate an exception

Modified: pypy/dist/pypy/objspace/std/inttype.py
==============================================================================
--- pypy/dist/pypy/objspace/std/inttype.py	(original)
+++ pypy/dist/pypy/objspace/std/inttype.py	Mon May 30 14:52:16 2005
@@ -29,9 +29,10 @@
             except ParseStringOverflowError, e:
                  w_longval = retry_to_w_long(space, e.parser)                
         elif space.is_true(space.isinstance(w_value, space.w_unicode)):
+            from unicodeobject import unicode_to_decimal_w
+            string = unicode_to_decimal_w(space, w_value)
             try:
-                from unicodeobject import unicode_to_decimal_w
-                value = string_to_int(space, unicode_to_decimal_w(space, w_value))
+                value = string_to_int(space, string)
             except ParseStringError, e:
                 raise OperationError(space.w_ValueError,
                                      space.wrap(e.msg))



More information about the Pypy-commit mailing list