summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-10-23 02:21:52 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-10-23 02:21:52 (GMT)
commitc77db34575f8ea73a5f53baf5a68fb0d39850573 (patch)
treef1138884f8a962782ee0ee3481690d2d1ad0bd2e /Lib
parent90b689076a6dcb55dcac6c5efbc9e4aa793e6c72 (diff)
downloadcpython-c77db34575f8ea73a5f53baf5a68fb0d39850573.zip
cpython-c77db34575f8ea73a5f53baf5a68fb0d39850573.tar.gz
cpython-c77db34575f8ea73a5f53baf5a68fb0d39850573.tar.bz2
SF bug [#473864] doctest expects spurios space.
Repair unlikely surprise due to magical softspace attr and the use of print with a trailing comma in doctest examples. Bugfix candidate.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/doctest.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/doctest.py b/Lib/doctest.py
index 91c51cb..2829f1e 100644
--- a/Lib/doctest.py
+++ b/Lib/doctest.py
@@ -379,9 +379,15 @@ class _SpoofOut:
# that a trailing newline is missing.
if guts and not guts.endswith("\n"):
guts = guts + "\n"
+ # Prevent softspace from screwing up the next test case, in
+ # case they used print with a trailing comma in an example.
+ if hasattr(self, "softspace"):
+ del self.softspace
return guts
def clear(self):
self.buf = []
+ if hasattr(self, "softspace"):
+ del self.softspace
def flush(self):
# JPython calls flush
pass