mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
[3.10] bpo-44446: support lineno being None in traceback.FrameSummary (GH-26781) (GH-27072)
As of088a15c49d
, lineno is None instead of -1 if there is no line number. Signed-off-by: Filipe Laíns <lains@riseup.net>. (cherry picked from commit91a8f8c16c
) Co-authored-by: Filipe Laíns <lains@riseup.net> Co-authored-by: Filipe Laíns <lains@riseup.net>
This commit is contained in:
parent
08697ac5d1
commit
61eb9b5dfd
3 changed files with 9 additions and 3 deletions
|
@ -1001,6 +1001,10 @@ class TestFrame(unittest.TestCase):
|
|||
'"""Test cases for traceback module"""',
|
||||
f.line)
|
||||
|
||||
def test_no_line(self):
|
||||
f = traceback.FrameSummary("f", None, "dummy")
|
||||
self.assertEqual(f.line, None)
|
||||
|
||||
def test_explicit_line(self):
|
||||
f = traceback.FrameSummary("f", 1, "dummy", line="line")
|
||||
self.assertEqual("line", f.line)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue