Skip to content

Commit 0a61d7f

Browse files
committed
Fix test_profiling
1 parent 79f7cd3 commit 0a61d7f

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

Lib/profiling/sampling/collector.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ def extract_lineno(location):
4747
return 0
4848
if isinstance(location, int):
4949
return location
50-
return location[0]
50+
try:
51+
return location[0]
52+
except DeprecationWarning as exc:
53+
raise Exception(type(location)) from exc
5154

5255
def _is_internal_frame(frame):
5356
if isinstance(frame, tuple):

Lib/test/test_profiling/test_sampling_profiler/_live_collector_helpers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99

1010

1111
# Matches the C structseq LocationInfo from _remote_debugging
12-
LocationInfo = namedtuple('LocationInfo', ['lineno', 'end_lineno', 'col_offset', 'end_col_offset'])
12+
LocationInfo = namedtuple('LocationInfo',
13+
['lineno', 'end_lineno', 'col_offset', 'end_col_offset'],
14+
deprecate_tuple_api=False)
1315

1416

1517
class MockFrameInfo:

0 commit comments

Comments
 (0)