[pypy-commit] pypy default: Test and comments

arigo noreply at buildbot.pypy.org
Wed Oct 8 20:55:21 CEST 2014


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r73843:157413a91b38
Date: 2014-10-08 19:15 +0200
http://bitbucket.org/pypy/pypy/changeset/157413a91b38/

Log:	Test and comments

diff --git a/pypy/module/pypyjit/interp_jit.py b/pypy/module/pypyjit/interp_jit.py
--- a/pypy/module/pypyjit/interp_jit.py
+++ b/pypy/module/pypyjit/interp_jit.py
@@ -158,6 +158,7 @@
 
 @jit.not_in_trace
 def _call_not_in_trace(space, w_callable, __args__):
+    # this must return None
     space.call_args(w_callable, __args__)
 
 def not_from_assembler_new(space, w_subtype, w_callable):
@@ -169,6 +170,8 @@
 callable, but not from the JIT-produced assembler.  It is called
 from the interpreted mode, and from the JIT creation (pyjitpl) or
 exiting (blackhole) steps, but just not from the final assembler.
+The callable should return None!  (Its actual return value is
+ignored.)
 """,
     __new__ = interp2app(not_from_assembler_new),
     __call__ = interp2app(W_NotFromAssembler.descr_call),
diff --git a/pypy/module/pypyjit/test/test_jit_not_in_trace.py b/pypy/module/pypyjit/test/test_jit_not_in_trace.py
--- a/pypy/module/pypyjit/test/test_jit_not_in_trace.py
+++ b/pypy/module/pypyjit/test/test_jit_not_in_trace.py
@@ -9,3 +9,11 @@
             return 42
         r = f(3, 4)
         assert r is None
+
+    def test_not_from_assembler_exception(self):
+        import pypyjit
+        @pypyjit.not_from_assembler
+        def f(x, y):
+            raise ValueError(y, x)
+        e = raises(ValueError, f, 3, 4)
+        assert e.value.args == (4, 3)


More information about the pypy-commit mailing list