[pypy-svn] r13407 - in pypy/dist/pypy/rpython: . test

arigo at codespeak.net arigo at codespeak.net
Tue Jun 14 21:22:45 CEST 2005


Author: arigo
Date: Tue Jun 14 21:22:37 2005
New Revision: 13407

Modified:
   pypy/dist/pypy/rpython/rtyper.py
   pypy/dist/pypy/rpython/test/test_rtuple.py
Log:
Normalized the type of the exception-related data when catching it, in the
same way as we normalized it when raising it.


Modified: pypy/dist/pypy/rpython/rtyper.py
==============================================================================
--- pypy/dist/pypy/rpython/rtyper.py	(original)
+++ pypy/dist/pypy/rpython/rtyper.py	Tue Jun 14 21:22:37 2005
@@ -178,12 +178,19 @@
                     r_case = rclass.get_type_repr(self)
                 link.llexitcase = r_case.convert_const(link.exitcase)
 
-            for attr in ('last_exception', 'last_exc_value'):
-                a = getattr(link, attr)
-                if isinstance(a, Variable):
-                    self.setconcretetype(a)
-                elif isinstance(a, Constant):
-                    setattr(link, attr, self.typedconstant(a))
+            a = link.last_exception
+            if isinstance(a, Variable):
+                a.concretetype = self.exceptiondata.lltype_of_exception_type
+            elif isinstance(a, Constant):
+                link.last_exception = self.typedconstant(
+                    a, using_repr=self.exceptiondata.r_exception_type)
+
+            a = link.last_exc_value
+            if isinstance(a, Variable):
+                a.concretetype = self.exceptiondata.lltype_of_exception_value
+            elif isinstance(a, Constant):
+                link.last_exc_value = self.typedconstant(
+                    a, using_repr=self.exceptiondata.r_exception_value)
 
             inputargs_reprs = self.setup_block_entry(link.target)
             for i in range(len(link.args)):

Modified: pypy/dist/pypy/rpython/test/test_rtuple.py
==============================================================================
--- pypy/dist/pypy/rpython/test/test_rtuple.py	(original)
+++ pypy/dist/pypy/rpython/test/test_rtuple.py	Tue Jun 14 21:22:37 2005
@@ -48,4 +48,4 @@
 def test_return_tuple():
     def dummyfn(x, y):
         return (x<y, x>y)
-    rtype(dummyfn, [int, int]).view()
+    rtype(dummyfn, [int, int])



More information about the Pypy-commit mailing list