IronLanguages / main

Work for this repo has moved to https://github.com/IronLanguages/ironpython2
1.16k stars 347 forks source link

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

Open ironpythonbot opened 9 years ago

ironpythonbot commented 9 years ago
test_python25.py

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 commented 9 years ago

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.