Otherwise QuestionCommandLine will crash if its launched with an empty
stack (not that this should happen, but we should still avoid the
crash).
def _set_ps1(self):
"Pose a question and prompt"
- self.prompt = '\n{}\n{}'.format(
- self.question.format_prompt(), self._prompt)
+ if self.question:
+ self.prompt = '\n{}\n{}'.format(
+ self.question.format_prompt(), self._prompt)
+ else:
+ self.prompt = self._prompt
def _set_ps2(self):
"Just prompt (without the question, e.g. for multi-line answers)"