py3: use format_exc instead of print_exception#3078
Conversation
|
@MrOutis you left things like |
|
|
||
| exc = exc_info[1] | ||
| tb = buffer.getvalue() | ||
| tb = traceback.format_exc(*exc_info) |
There was a problem hiding this comment.
Note that we no longer need cause_tb down below, so tb_list will only contain one entry, so we should get rid of it.
| tb_list = [tb] | ||
|
|
||
| # NOTE: parsing chained exceptions. See dvc/exceptions.py for more info | ||
| while hasattr(exc, "__cause__") and exc.__cause__: |
There was a problem hiding this comment.
Again, what about __context__?
There was a problem hiding this comment.
@Suor , __context__? We are not using __context__, and that should be the matter of another PR, I guess 😕
There was a problem hiding this comment.
Python 3 automatically assigns __context__ when you raise an exception while handling exception. So if you don't use either from exc or from None you still can show the original cause, this is usually an error in an error handler, which we probably want to see.
@Suor , implicit errors don't work with the current implementation. |
|
@MrOutis implicit errors work when you |
|
@Suor we didn't have |
Related: #1818