[pypy-svn] r69492 - in pypy/branch/faster-raise/pypy/module/exceptions: . test

arigo at codespeak.net arigo at codespeak.net
Sat Nov 21 16:43:21 CET 2009


Author: arigo
Date: Sat Nov 21 16:43:21 2009
New Revision: 69492

Modified:
   pypy/branch/faster-raise/pypy/module/exceptions/interp_exceptions.py
   pypy/branch/faster-raise/pypy/module/exceptions/test/test_exc.py
Log:
Test and fix.


Modified: pypy/branch/faster-raise/pypy/module/exceptions/interp_exceptions.py
==============================================================================
--- pypy/branch/faster-raise/pypy/module/exceptions/interp_exceptions.py	(original)
+++ pypy/branch/faster-raise/pypy/module/exceptions/interp_exceptions.py	Sat Nov 21 16:43:21 2009
@@ -111,7 +111,7 @@
         if lgt == 0:
             return space.wrap('')
         elif lgt == 1:
-            return space.str(self.w_message)
+            return space.str(self.args_w[0])
         else:
             return space.str(space.newtuple(self.args_w))
     descr_str.unwrap_spec = ['self', ObjSpace]

Modified: pypy/branch/faster-raise/pypy/module/exceptions/test/test_exc.py
==============================================================================
--- pypy/branch/faster-raise/pypy/module/exceptions/test/test_exc.py	(original)
+++ pypy/branch/faster-raise/pypy/module/exceptions/test/test_exc.py	Sat Nov 21 16:43:21 2009
@@ -25,6 +25,7 @@
         assert x.xyz == 3
         x.args = [42]
         assert x.args == (42,)
+        assert str(x) == '42'
         assert x[0] == 42
         x.args = (1, 2, 3)
         assert x[1:2] == (2,)



More information about the Pypy-commit mailing list