mirror of
https://github.com/python/cpython.git
synced 2025-11-02 11:08:57 +00:00
gh-106922: Support multi-line error locations in traceback (attempt 2) (#112097)
This commit is contained in:
parent
5c5022b862
commit
939fc6d6ea
9 changed files with 706 additions and 124 deletions
|
|
@ -523,27 +523,32 @@ The output for the example would look similar to this:
|
|||
*** print_tb:
|
||||
File "<doctest...>", line 10, in <module>
|
||||
lumberjack()
|
||||
~~~~~~~~~~^^
|
||||
*** print_exception:
|
||||
Traceback (most recent call last):
|
||||
File "<doctest...>", line 10, in <module>
|
||||
lumberjack()
|
||||
~~~~~~~~~~^^
|
||||
File "<doctest...>", line 4, in lumberjack
|
||||
bright_side_of_life()
|
||||
~~~~~~~~~~~~~~~~~~~^^
|
||||
IndexError: tuple index out of range
|
||||
*** print_exc:
|
||||
Traceback (most recent call last):
|
||||
File "<doctest...>", line 10, in <module>
|
||||
lumberjack()
|
||||
~~~~~~~~~~^^
|
||||
File "<doctest...>", line 4, in lumberjack
|
||||
bright_side_of_life()
|
||||
~~~~~~~~~~~~~~~~~~~^^
|
||||
IndexError: tuple index out of range
|
||||
*** format_exc, first and last line:
|
||||
Traceback (most recent call last):
|
||||
IndexError: tuple index out of range
|
||||
*** format_exception:
|
||||
['Traceback (most recent call last):\n',
|
||||
' File "<doctest default[0]>", line 10, in <module>\n lumberjack()\n',
|
||||
' File "<doctest default[0]>", line 4, in lumberjack\n bright_side_of_life()\n',
|
||||
' File "<doctest default[0]>", line 10, in <module>\n lumberjack()\n ~~~~~~~~~~^^\n',
|
||||
' File "<doctest default[0]>", line 4, in lumberjack\n bright_side_of_life()\n ~~~~~~~~~~~~~~~~~~~^^\n',
|
||||
' File "<doctest default[0]>", line 7, in bright_side_of_life\n return tuple()[0]\n ~~~~~~~^^^\n',
|
||||
'IndexError: tuple index out of range\n']
|
||||
*** extract_tb:
|
||||
|
|
@ -551,8 +556,8 @@ The output for the example would look similar to this:
|
|||
<FrameSummary file <doctest...>, line 4 in lumberjack>,
|
||||
<FrameSummary file <doctest...>, line 7 in bright_side_of_life>]
|
||||
*** format_tb:
|
||||
[' File "<doctest default[0]>", line 10, in <module>\n lumberjack()\n',
|
||||
' File "<doctest default[0]>", line 4, in lumberjack\n bright_side_of_life()\n',
|
||||
[' File "<doctest default[0]>", line 10, in <module>\n lumberjack()\n ~~~~~~~~~~^^\n',
|
||||
' File "<doctest default[0]>", line 4, in lumberjack\n bright_side_of_life()\n ~~~~~~~~~~~~~~~~~~~^^\n',
|
||||
' File "<doctest default[0]>", line 7, in bright_side_of_life\n return tuple()[0]\n ~~~~~~~^^^\n']
|
||||
*** tb_lineno: 10
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue