[issue10150] Local references not released after exception

2010-10-20 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: Alex is correct. (You can prove that by raising and catching another exception before the second getrefcount().) -- nosy: +georg.brandl resolution: - wont fix status: open - closed ___ Python

[issue10150] Local references not released after exception

2010-10-19 Thread James Bowman
New submission from James Bowman bowmana...@gmail.com: import sys def foo(): x = [o] * 100 raise ArithmeticError o = something print sys.getrefcount(o) try: foo() except ArithmeticError: pass print sys.getrefcount(o) --- Gives: 4 104

[issue10150] Local references not released after exception

2010-10-19 Thread Alex
Alex alex.gay...@gmail.com added the comment: That's because in Python 2.5 at that point in the code sys.exc_info() still points at the traceback (and by extension, the frame) thus x is not deallocated yet. I don't think this is a bug. -- nosy: +alex