mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +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
|
@ -1115,8 +1115,10 @@ class SysModuleTest(unittest.TestCase):
|
|||
b'Traceback (most recent call last):',
|
||||
b' File "<string>", line 8, in <module>',
|
||||
b' f2()',
|
||||
b' ~~^^',
|
||||
b' File "<string>", line 6, in f2',
|
||||
b' f1()',
|
||||
b' ~~^^',
|
||||
b' File "<string>", line 4, in f1',
|
||||
b' 1 / 0',
|
||||
b' ~~^~~',
|
||||
|
@ -1124,8 +1126,8 @@ class SysModuleTest(unittest.TestCase):
|
|||
]
|
||||
check(10, traceback)
|
||||
check(3, traceback)
|
||||
check(2, traceback[:1] + traceback[3:])
|
||||
check(1, traceback[:1] + traceback[5:])
|
||||
check(2, traceback[:1] + traceback[4:])
|
||||
check(1, traceback[:1] + traceback[7:])
|
||||
check(0, [traceback[-1]])
|
||||
check(-1, [traceback[-1]])
|
||||
check(1<<1000, traceback)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue