summaryrefslogtreecommitdiff
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
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.
-rw-r--r--CHANGES9
-rw-r--r--pygments/lexers/agile.py6
-rw-r--r--tests/examplefiles/pycon_test.pycon6
3 files changed, 16 insertions, 5 deletions
diff --git a/CHANGES b/CHANGES
index cd67fc6a..342f9a98 100644
--- a/CHANGES
+++ b/CHANGES
@@ -3,9 +3,12 @@ Pygments changelog
Issue numbers refer to the tracker at http://dev.pocoo.org/projects/pygments/.
-Version 1.3
------------
-(in development, to be released in 2010)
+Version 1.2.1
+-------------
+(bugfix release, released Jan 02, 2010)
+
+* Fix mishandling of an ellipsis in place of the frames in a Python
+ console traceback, resulting in clobbered output.
Version 1.2
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:]
diff --git a/tests/examplefiles/pycon_test.pycon b/tests/examplefiles/pycon_test.pycon
index 5ed452e1..ff702864 100644
--- a/tests/examplefiles/pycon_test.pycon
+++ b/tests/examplefiles/pycon_test.pycon
@@ -6,3 +6,9 @@ SyntaxError: invalid syntax
>>>
KeyboardInterrupt
>>>
+
+>>> 1/0
+Traceback (most recent call last):
+...
+ZeroDivisionError
+