ui.cli: Don't start the QuestionCommandLine with an empty stack
authorW. Trevor King <wking@tremily.us>
Wed, 6 Feb 2013 21:55:15 +0000 (16:55 -0500)
committerW. Trevor King <wking@tremily.us>
Wed, 6 Feb 2013 21:55:29 +0000 (16:55 -0500)
There's not much point in a question-answering shell if there are no
questions to be answered.

quizzer/ui/cli.py

index d2859cfdbd15e6cf07599034cdddd61f4717f6a6..b799e1e209ecc74879f323e31521bfeddf8ce36f 100644 (file)
@@ -112,6 +112,8 @@ class QuestionCommandLine (_cmd.Cmd):
 
 class CommandLineInterface (UserInterface):
     def run(self):
+        if not self.stack:
+            return
         cmd = QuestionCommandLine(ui=self)
         cmd.cmdloop()
         print()