Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix possible truncated source while colorizing traceback in Python 3.12
In particular, a "\" at the end of a line (indicating line continuation) would have been lost. This is because prior to Python 3.12, the tokenizer would emit "ERRORTOKEN" (as the continuation of the line is not part of the traceback) but it would be colorized anyway. With Python 3.12, a "TokenError" is raised instead, which cause the token iteration to end prematurely. Because of a typo in the code, the final part of the source (usually empty, except if it couldn't be tokenized) wasn't added to the output string.
- Loading branch information