[pypy-svn] r60810 - pypy/branch/oo-jit/pypy/rlib

fijal at codespeak.net fijal at codespeak.net
Tue Jan 6 12:27:23 CET 2009


Author: fijal
Date: Tue Jan  6 12:27:22 2009
New Revision: 60810

Modified:
   pypy/branch/oo-jit/pypy/rlib/debug.py
Log:
A simple wrapper that raises AnnotatorError when function is attempted
to be annotated. Helps debugging


Modified: pypy/branch/oo-jit/pypy/rlib/debug.py
==============================================================================
--- pypy/branch/oo-jit/pypy/rlib/debug.py	(original)
+++ pypy/branch/oo-jit/pypy/rlib/debug.py	Tue Jan  6 12:27:22 2009
@@ -1,5 +1,6 @@
 import sys
 from pypy.rpython.extregistry import ExtRegistryEntry
+from pypy.tool.error import AnnotatorError
 
 def ll_assert(x, msg):
     """After translation to C, this becomes an RPyAssert."""
@@ -98,3 +99,11 @@
         hop.exception_cannot_occur()
         return hop.inputarg(hop.args_r[0], arg=0)
 
+def make_sure_not_translated(func):
+    class Entry(ExtRegistryEntry):
+        _about_ = func
+
+        def compute_result_annotation(self, *args):
+            raise AnnotatorError("Should not be here")
+
+    return func



More information about the Pypy-commit mailing list