[pypy-commit] pypy py3k: python3 changed the behavior in case we raise an exception from within a finally block: in python2 it was ignored and the main exception went through, in python3 the new exception is raised and the old one is set as __context__. Fix two tests to account for this change, they now pass with -A (but still fail on py.py)
antocuni
noreply at buildbot.pypy.org
Mon Feb 13 18:27:04 CET 2012
Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: py3k
Changeset: r52416:c5a89c7f55c5
Date: 2012-02-11 02:16 +0100
http://bitbucket.org/pypy/pypy/changeset/c5a89c7f55c5/
Log: python3 changed the behavior in case we raise an exception from
within a finally block: in python2 it was ignored and the main
exception went through, in python3 the new exception is raised and
the old one is set as __context__. Fix two tests to account for this
change, they now pass with -A (but still fail on py.py)
diff --git a/pypy/interpreter/test/test_raise.py b/pypy/interpreter/test/test_raise.py
--- a/pypy/interpreter/test/test_raise.py
+++ b/pypy/interpreter/test/test_raise.py
@@ -66,7 +66,7 @@
assert exc_tb is exc_tb2.tb_next
def test_reraise_1(self):
- raises(ValueError, """
+ raises(IndexError, """
import sys
try:
raise ValueError
@@ -74,15 +74,15 @@
try:
raise IndexError
finally:
- assert sys.exc_info()[0] is ValueError
+ assert sys.exc_info()[0] is IndexError
raise
""")
def test_reraise_2(self):
- raises(ValueError, """
+ raises(IndexError, """
def foo():
import sys
- assert sys.exc_info()[0] is ValueError
+ assert sys.exc_info()[0] is IndexError
raise
try:
raise ValueError
More information about the pypy-commit
mailing list