Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Erotemic committed Apr 28, 2024
1 parent f5f3c0e commit 7f71394
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/test_line_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ def test_show_func_column_formatting():
def get_func_linenos(func):
import sys
if sys.version_info[0:2] >= (3, 10):
return sorted(set([t[2] for t in func.__code__.co_lines()]))
return sorted(set([t[0] if t[2] is None else t[2]
for t in func.__code__.co_lines()]))
else:
import dis
return sorted(set([t[1] for t in dis.findlinestarts(func.__code__)]))
Expand Down

0 comments on commit 7f71394

Please sign in to comment.