Commits

Anonymous committed 4bbd901

Give Python3TracebackLexer a new name since it was shadowing the main
PythonTracebackLexer, which once again allows SyntaxError to work for pytb
files. Add example file to make sure of this in the future.

  • Participants
  • Parent commits 19bb407
  • Branches trunk

Comments (0)

Files changed (4)

File pygments/lexers/_mapping.py

     'PhpLexer': ('pygments.lexers.web', 'PHP', ('php', 'php3', 'php4', 'php5'), ('*.php', '*.php[345]'), ('text/x-php',)),
     'PovrayLexer': ('pygments.lexers.other', 'POVRay', ('pov',), ('*.pov', '*.inc'), ('text/x-povray',)),
     'Python3Lexer': ('pygments.lexers.agile', 'Python 3', ('python3', 'py3'), (), ('text/x-python3', 'application/x-python3')),
-    'Python3TracebackLexer': ('pygments.lexers.agile', 'Python Traceback', ('py3tb',), ('*.py3tb',), ('text/x-python3-traceback',)),
+    'Python3TracebackLexer': ('pygments.lexers.agile', 'Python 3.0 Traceback', ('py3tb',), ('*.py3tb',), ('text/x-python3-traceback',)),
     'PythonConsoleLexer': ('pygments.lexers.agile', 'Python console session', ('pycon',), (), ('text/x-python-doctest',)),
     'PythonLexer': ('pygments.lexers.agile', 'Python', ('python', 'py'), ('*.py', '*.pyw', '*.sc', 'SConstruct', 'SConscript'), ('text/x-python', 'application/x-python')),
     'PythonTracebackLexer': ('pygments.lexers.agile', 'Python Traceback', ('pytb',), ('*.pytb',), ('text/x-python-traceback',)),

File pygments/lexers/agile.py

     *New in Pygments 0.12.*
     """
 
-    name = 'Python Traceback'
+    name = 'Python 3.0 Traceback'
     aliases = ['py3tb']
     filenames = ['*.py3tb']
     mimetypes = ['text/x-python3-traceback']

File tests/examplefiles/pycon_test2.pycon

-Pilot:~/code/pygments/pygments-tim/tests/examplefiles tim$ python temp.py
-  File "temp.py", line 1
-SyntaxError: Non-ASCII character '\xc3' in file temp.py on line 1, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

File tests/examplefiles/pytb_test2.pytb

+  File "temp.py", line 1
+SyntaxError: Non-ASCII character '\xc3' in file temp.py on line 1, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details