Merge lp:~cjwatson/storm/py3-traceback-reference-cycles into lp:storm
Proposed by
Colin Watson
Status: | Merged |
---|---|
Merged at revision: | 572 |
Proposed branch: | lp:~cjwatson/storm/py3-traceback-reference-cycles |
Merge into: | lp:storm |
Diff against target: |
36 lines (+16/-4) 2 files modified
NEWS (+8/-0) storm/exceptions.py (+8/-4) |
To merge this branch: | bzr merge lp:~cjwatson/storm/py3-traceback-reference-cycles |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ioana Lasc (community) | Approve | ||
Storm Developers | Pending | ||
Review via email: mp+402726@code.launchpad.net |
Commit message
Avoid traceback reference cycles when wrapping exceptions.
Description of the change
`wrap_exceptions` stored the original exception's traceback in a local variable, but the traceback in turn contains a reference to that frame, creating a reference cycle. The situation is worse on Python 3, because the original exception also has the associated traceback as a `__traceback__` attribute, producing more complicated reference cycles. Delete these local variables before returning to avoid leaking memory over time.
To post a comment you must log in.