From 64806cca28d17ff11c7a92a4ca865cd0ecca55d9 2016-06-02 18:03:58 From: Thomas Kluyver Date: 2016-06-02 18:03:58 Subject: [PATCH] Merge pull request #9527 from Carreau/simple-prompt-update-layout Don't update PTK layout if --simple-shell --- diff --git a/IPython/terminal/ptshell.py b/IPython/terminal/ptshell.py index 8af3627..cf7fac1 100644 --- a/IPython/terminal/ptshell.py +++ b/IPython/terminal/ptshell.py @@ -152,6 +152,7 @@ class TerminalInteractiveShell(InteractiveShell): toggle_set_term_title(False) def init_prompt_toolkit_cli(self): + self._app = None if self.simple_prompt: # Fall back to plain non-interactive output for tests. # This is very limited, and only accepts a single line. @@ -300,7 +301,8 @@ class TerminalInteractiveShell(InteractiveShell): Ask for a re computation of the application layout, if for example , some configuration options have changed. """ - self._app.layout = create_prompt_layout(**self._layout_options()) + if self._app: + self._app.layout = create_prompt_layout(**self._layout_options()) def prompt_for_code(self): document = self.pt_cli.run(