main icon indicating copy to clipboard operation
main copied to clipboard

Stack trace for exceptions swallowed by context managers has changed in 2.7

Open ironpythonbot opened this issue 11 years ago • 1 comments

<Test>test_python25.py</Test>

Note how CPython 2.7 correctly picks up the most recent raised exception WRT sys.exc_info in the example below:

D:\rft\vsl\dlr\Languages\IronPython\Tests>type blah.py

import sys  

class M2():  
    def __enter__(self):  
        pass

    def __exit__(self, t,v, tb):  
        return True


try:  
    raise ValueError(15)  
except:  
    with M2():  
        raise ValueError(34)

print sys.exc_info()  
D:\rft\vsl\dlr\Languages\IronPython\Tests>27 blah.py  
(<type 'exceptions.ValueError'>, ValueError(34,), <traceback object at 0x02037148>)  

D:\rft\vsl\dlr\Languages\IronPython\Tests>26 blah.py  
(<type 'exceptions.ValueError'>, ValueError(15,), <traceback object at 0x02189D50>)  

D:\rft\vsl\dlr\Languages\IronPython\Tests>ipyd blah.py  
(<type 'exceptions.ValueError'>, ValueError(15,), <traceback object at 0x000000000000002B>)  

Work Item Details

Original CodePlex Issue: Issue 27990 Status: Active Reason Closed: Unassigned Assigned to: Unassigned Reported on: Jul 6, 2010 at 11:27 PM Reported by: dfugate Updated on: Feb 22, 2013 at 2:10 AM Updated by: jdhardy Test: test_excinfo.py (test_with_except_fail)

ironpythonbot avatar Dec 09 '14 17:12 ironpythonbot

On 2010-07-22 05:43:45 UTC, dfugate commented:

I believe this is the culprit behind test_python.py's "# Building up most complex TRY-CATCH-FINALLY-RAISE-WITH-CLASS combination with inheritance." failing as well.

ironpythonbot avatar Dec 09 '14 17:12 ironpythonbot