Skip to content
This repository has been archived by the owner on Jun 9, 2020. It is now read-only.

fixes #47 #72

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion line_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,10 @@ def show_func(filename, start_lineno, func_name, timings, unit, stream=None, str
stream.write("that you ran the profiler from?\n")
stream.write("Continuing without the function's contents.\n")
# Fake empty lines so we can see the timings, if not the code.
nlines = max(linenos) - min(min(linenos), start_lineno) + 1
if linenos:
nlines = max(linenos) - min(min(linenos), start_lineno) + 1
else:
nlines = 1
sublines = [''] * nlines
for lineno, nhits, time in timings:
d[lineno] = (nhits, time, '%5.1f' % (float(time) / nhits),
Expand Down