Kaydet (Commit) 1f149642 authored tarafından Georg Brandl's avatar Georg Brandl

bug [ 1172785 ] doctest.script_from_examples() result sometimes un-exec-able

üst 2f210b6b
......@@ -2498,7 +2498,8 @@ def script_from_examples(s):
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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment