diff options
-rw-r--r-- | CHANGES | 2 | ||||
-rw-r--r-- | pygments/lexers/python.py | 3 | ||||
-rw-r--r-- | tests/examplefiles/pycon_test.pycon | 5 |
3 files changed, 9 insertions, 1 deletions
@@ -137,6 +137,8 @@ Version 2.0 - Elixir lexer: update to 0.15 language version (PR#392). +- Fix swallowing incomplete tracebacks in Python console lexer (#874). + Version 1.6 ----------- diff --git a/pygments/lexers/python.py b/pygments/lexers/python.py index 6cd0a6c8..411f7bc7 100644 --- a/pygments/lexers/python.py +++ b/pygments/lexers/python.py @@ -384,6 +384,9 @@ class PythonConsoleLexer(Lexer): for item in do_insertions(insertions, pylexer.get_tokens_unprocessed(curcode)): yield item + if curtb: + for i, t, v in tblexer.get_tokens_unprocessed(curtb): + yield tbindex+i, t, v class PythonTracebackLexer(RegexLexer): diff --git a/tests/examplefiles/pycon_test.pycon b/tests/examplefiles/pycon_test.pycon index ff702864..9c4fc3d3 100644 --- a/tests/examplefiles/pycon_test.pycon +++ b/tests/examplefiles/pycon_test.pycon @@ -9,6 +9,9 @@ KeyboardInterrupt >>> 1/0 Traceback (most recent call last): -... + ... ZeroDivisionError +>>> 1/0 # this used to swallow the traceback +Traceback (most recent call last): + ... |