Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit17ae881

Browse files
committed
Update for new Python traceback locations
Sincepython/cpython#27037, they can includetildes in addition to the carets.
1 parentc28a7f1 commit17ae881

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

‎pygments/lexers/python.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ class PythonTracebackLexer(RegexLexer):
739739
# Either `PEP 657 <https://www.python.org/dev/peps/pep-0657/>`
740740
# error locations in Python 3.11+, or single-caret markers
741741
# for syntax errors before that.
742-
(r'^( {4,})(\^+)(\n)',
742+
(r'^( {4,})([~^]+)(\n)',
743743
bygroups(Text,Punctuation.Marker,Text),
744744
'#pop'),
745745
default('#pop'),

‎tests/examplefiles/pytb/error_locations.pytb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ Traceback (most recent call last):
1313
^^^^^^^^^^^^^^^
1414
File"/home/tb.py", line11, inin_tracebacks
1515
return1/0
16-
^^^
16+
~^~
1717
ZeroDivisionError:division by zero

‎tests/examplefiles/pytb/error_locations.pytb.output‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp