Skip to content
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: 7 additions & 4 deletions ValgrindCI/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,13 @@ def _extract_error_data(
stack["fileref"] = "{}:{}".format(
frame.get_path(self._source_dir), error_line
)
with open(fullname, "r") as f:
for l, code_line in enumerate(f.readlines()):
if l >= stack["line"] and l <= error_line + lines_after - 1:
stack["code"].append(code_line)
try:
with open(fullname, "r") as f:
for l, code_line in enumerate(f.readlines()):
if l >= stack["line"] and l <= error_line + lines_after - 1:
stack["code"].append(code_line)
except FileNotFoundError:
stack["code"].append("/* Source file not available or could not be opened. */")
issue["stack"].append(stack)
return issue

Expand Down