Fix IndexError for when stdout and stderr of formatter are empty.
This commit is contained in:
parent
bf57abea05
commit
b939719fe6
@ -181,7 +181,7 @@ else:
|
|||||||
# However, extra newlines are almost never required, while there are linters that complain
|
# However, extra newlines are almost never required, while there are linters that complain
|
||||||
# about superfluous newlines, so we remove one empty newline at the end of the file.
|
# about superfluous newlines, so we remove one empty newline at the end of the file.
|
||||||
for eol in possible_eols:
|
for eol in possible_eols:
|
||||||
if stdoutdata[-1] == eol:
|
if len(stdoutdata) > 0 and stdoutdata[-1] == eol:
|
||||||
stdoutdata = stdoutdata[:-1]
|
stdoutdata = stdoutdata[:-1]
|
||||||
|
|
||||||
lines = [stdoutdata]
|
lines = [stdoutdata]
|
||||||
@ -231,7 +231,7 @@ else:
|
|||||||
# However, extra newlines are almost never required, while there are linters that complain
|
# However, extra newlines are almost never required, while there are linters that complain
|
||||||
# about superfluous newlines, so we remove one empty newline at the end of the file.
|
# about superfluous newlines, so we remove one empty newline at the end of the file.
|
||||||
for eol in possible_eols:
|
for eol in possible_eols:
|
||||||
if stdoutdata[-1] == eol:
|
if len(stdoutdata) > 0 and stdoutdata[-1] == eol:
|
||||||
stdoutdata = stdoutdata[:-1]
|
stdoutdata = stdoutdata[:-1]
|
||||||
|
|
||||||
lines = [stdoutdata]
|
lines = [stdoutdata]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user