Author: Philip Jenvey <pjen...@underboss.org>
Branch: 
Changeset: r83956:c4d7b8fef89a
Date: 2016-04-26 21:47 -0700
http://bitbucket.org/pypy/pypy/changeset/c4d7b8fef89a/

Log:    fix reraise in hidden functions

diff --git a/pypy/interpreter/pyopcode.py b/pypy/interpreter/pyopcode.py
--- a/pypy/interpreter/pyopcode.py
+++ b/pypy/interpreter/pyopcode.py
@@ -742,7 +742,7 @@
     def RAISE_VARARGS(self, nbargs, next_instr):
         space = self.space
         if nbargs == 0:
-            last_operr = self._exc_info_unroll(space)
+            last_operr = self._exc_info_unroll(space, for_hidden=True)
             if last_operr is None:
                 raise oefmt(space.w_TypeError,
                             "No active exception to reraise")
diff --git a/pypy/module/__pypy__/test/test_special.py 
b/pypy/module/__pypy__/test/test_special.py
--- a/pypy/module/__pypy__/test/test_special.py
+++ b/pypy/module/__pypy__/test/test_special.py
@@ -60,6 +60,7 @@
         import __pypy__
         import sys
 
+        result = [False]
         @__pypy__.hidden_applevel
         def test_hidden_with_tb():
             def not_hidden(): 1/0
@@ -68,9 +69,11 @@
                 assert sys.exc_info() == (None, None, None)
                 tb = __pypy__.get_hidden_tb()
                 assert tb.tb_frame.f_code.co_name == 'not_hidden'
-                return True
+                result[0] = True
+                raise
             else: return False
-        assert test_hidden_with_tb()
+        raises(ZeroDivisionError, test_hidden_with_tb)
+        assert result[0]
 
     def test_lookup_special(self):
         from __pypy__ import lookup_special
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to