Irit Katriel <iritkatr...@gmail.com> added the comment:

I'm pretty sure the frame locals is involved. 

This leaks (note that a is being re-raised, not b):

---------------------
def test_no_hang_on_context_chain_cycle2():
    class A(Exception): pass
    class B(Exception): pass

    try:
        try:
            raise A()
        except A as _a:
            a = _a
            try:
                raise B() 
            except B as _b:
                b = _b
        raise a 
    except A: 
        pass
---------------------

But this doesn't leak:

---------------------
def test_no_hang_on_context_chain_cycle2():
    class A(Exception): pass
    class B(Exception): pass

    try:
        try:
            raise A()
        except A as _a:
            a = _a
            try:
                raise B() 
            except B as _b:
                pass # b = _b  <== not saving b in a local
        raise a 
    except A: 
        pass
---------------------

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue44895>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to