-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove last exception's references if any #59
Conversation
finally: | ||
for attribute in ['last_type', 'last_value', 'last_traceback']: | ||
try: | ||
delattr(sys, attribute) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably better to set to None instead? This would trigger AttributeErrors - afaik the python docs give the impression that these attributes would always be there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooof, actually I'm wrong https://docs.python.org/3/library/sys.html?highlight=last_traceback#sys.last_traceback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, they're not defined by default. So I'm reverting them to the original state
Can you also update changelog/authors.rst ? |
Like this? |
Codecov Report
@@ Coverage Diff @@
## master #59 +/- ##
==========================================
- Coverage 83.98% 83.10% -0.88%
==========================================
Files 6 6
Lines 1255 1261 +6
Branches 134 135 +1
==========================================
- Hits 1054 1048 -6
- Misses 164 175 +11
- Partials 37 38 +1
Continue to review full report at Codecov.
|
Yes, thanks! |
code
module used underneath stores exception details in sys module.That creates a memory leak in case of exception in
manhole
session. This exception encapsulates entire session with all stack frames with their locals and manhole internals (such asManholeConsole
instance and connection file wrapper).Simple test. Call this via manhole and target process will be 100Mb bigger even after disconnect: