summaryrefslogtreecommitdiff
path: root/pygments/lexers/agile.py
diff options
context:
space:
mode:
Diffstat (limited to 'pygments/lexers/agile.py')
-rw-r--r--pygments/lexers/agile.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/pygments/lexers/agile.py b/pygments/lexers/agile.py
index 40f29c5e..01daa990 100644
--- a/pygments/lexers/agile.py
+++ b/pygments/lexers/agile.py
@@ -319,8 +319,10 @@ class PythonConsoleLexer(Lexer):
insertions.append((len(curcode),
[(0, Generic.Prompt, line[:4])]))
curcode += line[4:]
- elif line.rstrip() == '...':
- tb = 0
+ elif line.rstrip() == '...' and not tb:
+ # only a new >>> prompt can end an exception block
+ # otherwise an ellipsis in place of the traceback frames
+ # will be mishandled
insertions.append((len(curcode),
[(0, Generic.Prompt, '...')]))
curcode += line[3:]