Skip to content

Commit a6c4509

Browse files
authored
Use repr to format out/err in dmypy verbose stats output (#8374)
This prevents control characters being interpreted, though it does uglify the output in its own way.
1 parent 17b0a7a commit a6c4509

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mypy/dmypy/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ def show_stats(response: Mapping[str, object]) -> None:
413413
if key not in ('out', 'err'):
414414
print("%-24s: %10s" % (key, "%.3f" % value if isinstance(value, float) else value))
415415
else:
416-
value = str(value).replace('\n', '\\n')
416+
value = repr(value)[1:-1]
417417
if len(value) > 50:
418418
value = value[:40] + ' ...'
419419
print("%-24s: %s" % (key, value))

0 commit comments

Comments
 (0)