summaryrefslogtreecommitdiff
path: root/Lib/doctest.py
diff options
context:
space:
mode:
authorSenthil Kumaran <skumaran@gatech.edu>2019-01-10 09:34:00 -0800
committerGitHub <noreply@github.com>2019-01-10 09:34:00 -0800
commit786a66db2665aa4528bf94f594d807ae2c96fb8b (patch)
tree9ab61d6417c016d5910201fca044ebe32e3ea53a /Lib/doctest.py
parent5d9ae8b9df8371dd65514e0d60b561fd37056986 (diff)
downloadcpython-git-revert-11477-backport-cbb1645-3.6.tar.gz
Revert "bpo-24746: Avoid stripping trailing whitespace in doctest fancy diff (GH-10639) (#11477)"revert-11477-backport-cbb1645-3.6
This reverts commit 5d9ae8b9df8371dd65514e0d60b561fd37056986.
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