summaryrefslogtreecommitdiff
path: root/Lib/doctest.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/doctest.py')
-rw-r--r--Lib/doctest.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/doctest.py b/Lib/doctest.py
index ca5be59275..0b78544d8d 100644
--- a/Lib/doctest.py
+++ b/Lib/doctest.py
@@ -1691,6 +1691,8 @@ class OutputChecker:
kind = 'ndiff with -expected +actual'
else:
assert 0, 'Bad diff option'
+ # Remove trailing whitespace on diff output.
+ diff = [line.rstrip() + '\n' for line in diff]
return 'Differences (%s):\n' % kind + _indent(''.join(diff))
# If we're not using diff, then simply list the expected