From 86aa8a5e98e5742bb5bb6ab617f08b1679b33b55 Mon Sep 17 00:00:00 2001 From: Juhi Chandalia Date: Tue, 25 Apr 2023 15:23:35 -0600 Subject: [PATCH] GH-103804: Add test for dis.findlinestarts (#103806) --- Lib/test/test_dis.py | 8 ++++++++ Misc/ACKS | 1 + 2 files changed, 9 insertions(+) diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py index 2d5c73c9adc920..97960726991b76 100644 --- a/Lib/test/test_dis.py +++ b/Lib/test/test_dis.py @@ -1935,6 +1935,14 @@ def test_findlabels(self): self.assertEqual(sorted(labels), sorted(jumps)) + def test_findlinestarts(self): + def func(): + pass + + code = func.__code__ + offsets = [linestart[0] for linestart in dis.findlinestarts(code)] + self.assertEqual(offsets, [0, 2]) + class TestDisTraceback(DisTestBase): def setUp(self) -> None: diff --git a/Misc/ACKS b/Misc/ACKS index 633e9d90a36f16..19475698a4bc37 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -299,6 +299,7 @@ Dave Chambers Pascal Chambon Nicholas Chammas Ofey Chan +Juhi Chandalia John Chandler Hye-Shik Chang Jeffrey Chang