summaryrefslogtreecommitdiff
path: root/pygments
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-01-02 15:14:38 +0100
committerGeorg Brandl <georg@python.org>2010-01-02 15:14:38 +0100
commitc234f3d35f24c70516798fb8c39de87ea2981e1e (patch)
treec5a7ef5a5603e892e20bb4be46aa9bbafdc28f32 /pygments
parent36a9e272623c09cd77dd3267f6a885a3d98fed49 (diff)
downloadpygments-c234f3d35f24c70516798fb8c39de87ea2981e1e.tar.gz
Fix mishandling of an ellipsis in place of the frames in a Python
console traceback, resulting in clobbered output.
Diffstat (limited to 'pygments')
-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:]