Merge lp://staging/~cjwatson/storm/py3-traceback-reference-cycles into lp://staging/storm

Proposed by Colin Watson
Status: Merged
Merged at revision: 572
Proposed branch: lp://staging/~cjwatson/storm/py3-traceback-reference-cycles
Merge into: lp://staging/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://staging/~cjwatson/storm/py3-traceback-reference-cycles
Reviewer Review Type Date Requested Status
Ioana Lasc (community) Approve
Storm Developers Pending
Review via email: mp+402726@code.staging.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.
Revision history for this message
Ioana Lasc (ilasc) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to status/vote changes: