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
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
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