Skip to content

Commit 278a10a

Browse files
ilinumgvanrossum
authored andcommitted
Fix last character cut in html-report if file does not end with newline (#3466)
1 parent 3ba42e8 commit 278a10a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mypy/report.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def on_file(self,
334334
etree.SubElement(root, 'line',
335335
number=str(lineno),
336336
precision=stats.precision_names[status],
337-
content=line_text[:-1])
337+
content=line_text.rstrip('\n'))
338338
# Assumes a layout similar to what XmlReporter uses.
339339
xslt_path = os.path.relpath('mypy-html.xslt', path)
340340
transform_pi = etree.ProcessingInstruction('xml-stylesheet',

0 commit comments

Comments
 (0)