Skip to content

Commit

Permalink
Fix lint warning on Travis.
Browse files Browse the repository at this point in the history
  • Loading branch information
nvdv committed Sep 25, 2017
1 parent 950b30a commit d60c54c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions vprof/code_heatmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,14 @@ def record_line(self, frame, event, arg): # pylint: disable=unused-argument
def lines_without_stdlib(self):
"""Filters code from standard library from self.lines."""
prev_line = None
current_module_path = inspect.getabsfile(inspect.currentframe())
for line_stats in self.lines:
path, _, runtime = line_stats
module_path, _, runtime = line_stats
if not prev_line:
prev_line = line_stats
else:
if (not check_standard_dir(path) and
path != inspect.getabsfile(inspect.currentframe())):
if (not check_standard_dir(module_path) and
module_path != current_module_path):
yield prev_line
prev_line = line_stats
else:
Expand All @@ -83,9 +84,9 @@ def lines_without_stdlib(self):

def fill_heatmap(self):
"""Fills code heatmap and execution count dictionaries."""
for path, lineno, runtime in self.lines_without_stdlib:
self._execution_count[path][lineno] += 1
self._heatmap[path][lineno] += runtime
for module_path, lineno, runtime in self.lines_without_stdlib:
self._execution_count[module_path][lineno] += 1
self._heatmap[module_path][lineno] += runtime

@property
def heatmap(self):
Expand Down

0 comments on commit d60c54c

Please sign in to comment.