[pypy-svn] r14313 - pypy/branch/dist-2.4.1/pypy/interpreter

arigo at codespeak.net arigo at codespeak.net
Tue Jul 5 21:43:48 CEST 2005


Author: arigo
Date: Tue Jul  5 21:43:45 2005
New Revision: 14313

Modified:
   pypy/branch/dist-2.4.1/pypy/interpreter/error.py
Log:
Avoiding to crash PyPy when displaying an exception raises an exception.


Modified: pypy/branch/dist-2.4.1/pypy/interpreter/error.py
==============================================================================
--- pypy/branch/dist-2.4.1/pypy/interpreter/error.py	(original)
+++ pypy/branch/dist-2.4.1/pypy/interpreter/error.py	Tue Jul  5 21:43:45 2005
@@ -51,7 +51,11 @@
             if self.w_value == space.w_None:
                 exc_value = None
             else:
-                exc_value = space.str_w(space.str(self.w_value))
+                try:
+                    exc_value = space.str_w(space.str(self.w_value))
+                except OperationError:
+                    # oups, cannot __str__ the exception object
+                    exc_value = "<oups, exception object itself cannot be str'd>"
         if not exc_value:
             return exc_typename
         else:



More information about the Pypy-commit mailing list