question: Add a trailing newline to ScriptQuestion scripts
authorW. Trevor King <wking@tremily.us>
Wed, 6 Feb 2013 02:31:01 +0000 (21:31 -0500)
committerW. Trevor King <wking@tremily.us>
Wed, 6 Feb 2013 02:31:01 +0000 (21:31 -0500)
quizzer/question.py

index 96449541e229bb0c410915c0db52e067fd1123e2..43e72b6dd79254365df4d2996410830afd2e2f9e 100644 (file)
@@ -132,7 +132,7 @@ class ScriptQuestion (Question):
         prefix = '{}-'.format(type(self).__name__)
         if not self.multiline:
             answer = [answer]
-        script = '\n'.join(self.setup + answer + self.teardown)
+        script = '\n'.join(self.setup + answer + self.teardown + [''])
         with _tempfile.NamedTemporaryFile(
                 mode='w', prefix='{}script-'.format(prefix)) as tempscript:
             tempscript.write(script)