[Python-checkins] python/dist/src/Lib doctest.py,1.122,1.123
birkenfeld@users.sourceforge.net
birkenfeld at users.sourceforge.net
Mon Jun 27 00:22:34 CEST 2005
Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14574/Lib
Modified Files:
doctest.py
Log Message:
bug [ 1172785 ] doctest.script_from_examples() result sometimes un-exec-able
Index: doctest.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/doctest.py,v
retrieving revision 1.122
retrieving revision 1.123
diff -u -d -r1.122 -r1.123
--- doctest.py 28 Mar 2005 23:50:54 -0000 1.122
+++ doctest.py 26 Jun 2005 22:22:31 -0000 1.123
@@ -2498,7 +2498,8 @@
while output and output[0] == '#':
output.pop(0)
# Combine the output, and return it.
- return '\n'.join(output)
+ # Add a courtesy newline to prevent exec from choking (see bug #1172785)
+ return '\n'.join(output) + '\n'
def testsource(module, name):
"""Extract the test sources from a doctest docstring as a script.
More information about the Python-checkins
mailing list