[issue27565] Offer error context manager for code.interact

2016-09-28 Thread Berker Peksag
Berker Peksag added the comment: Hi Claudiu, thanks for the report, but I don't think this is a common use case that needs to be supported in the standard library. Other people may prefer to use different solutions in a similar case (e.g. using a debugger) Plus, it's not hard to implement this

[issue27565] Offer error context manager for code.interact

2016-07-18 Thread Claudiu Saftoiu
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: