Skip to content

Commit

Permalink
[refactor] Tidy up error banner generation (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-koch authored Oct 9, 2023
1 parent 3d51907 commit f5d5be0
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions guppy/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ def format_source_location(
]
longest = max(len(ln) for ln in line_numbers)
prefixes = [ln + " " * (longest - len(ln) + indent) for ln in line_numbers]
res = ""
for prefix, line in zip(prefixes, s[:-1]):
res += prefix + line + "\n"
res = "".join(prefix + line + "\n" for prefix, line in zip(prefixes, s[:-1]))
res += (longest + indent) * " " + s[-1]
return res

Expand Down

0 comments on commit f5d5be0

Please sign in to comment.