New submission from Claudiu Saftoiu:
When debugging code that raises unexpected exceptions, I often find myself
doing this:
try:
some_code
except:
import code; code.interact(local=locals())
raise
My suggestion is a context manager to make this less verbose:
with code.interact_on_error():
some_code
The effect would be the same: if an exception is caught, `code.interact` is
called with the locals of the function, and re-raised when `code.interact` ends.
----------
components: Library (Lib)
messages: 270786
nosy: Claudiu Saftoiu
priority: normal
severity: normal
status: open
title: Offer error context manager for code.interact
type: enhancement
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue27565>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com