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

don't print source lines without timing (docstrings, comments) #159

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
11 changes: 6 additions & 5 deletions line_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,12 @@ def show_func(filename, start_lineno, func_name, timings, unit,
stream.write('=' * len(header))
stream.write("\n")
for lineno, line in zip(linenos, sublines):
nhits, time, per_hit, percent = d.get(lineno, empty)
txt = template % (lineno, nhits, time, per_hit, percent,
line.rstrip('\n').rstrip('\r'))
stream.write(txt)
stream.write("\n")
if lineno in d:
nhits, time, per_hit, percent = d.get(lineno, empty)
txt = template % (lineno, nhits, time, per_hit, percent,
line.rstrip('\n').rstrip('\r'))
stream.write(txt)
stream.write("\n")
stream.write("\n")

def show_text(stats, unit, output_unit=None, stream=None, stripzeros=False):
Expand Down