From a1286777c99ef52ed28ff1866addb0d86b4f2d70 2015-08-22 01:20:41 From: Yuri Numerov Date: 2015-08-22 01:20:41 Subject: [PATCH] fixed exit confirmation glitch --- diff --git a/IPython/core/interactiveshell.py b/IPython/core/interactiveshell.py index 61079ac..3dbb7ad 100644 --- a/IPython/core/interactiveshell.py +++ b/IPython/core/interactiveshell.py @@ -3252,10 +3252,10 @@ class InteractiveShell(SingletonConfigurable): """Write a string to the default error output""" io.stderr.write(data) - def ask_yes_no(self, prompt, default=None): + def ask_yes_no(self, prompt, default=None, interrupt=None): if self.quiet: return True - return ask_yes_no(prompt,default) + return ask_yes_no(prompt,default,interrupt) def show_usage(self): """Show a usage message""" diff --git a/IPython/terminal/interactiveshell.py b/IPython/terminal/interactiveshell.py index 1a66d2e..326bc86 100644 --- a/IPython/terminal/interactiveshell.py +++ b/IPython/terminal/interactiveshell.py @@ -617,7 +617,7 @@ class TerminalInteractiveShell(InteractiveShell): This method calls the ask_exit callback.""" if self.confirm_exit: - if self.ask_yes_no('Do you really want to exit ([y]/n)?','y'): + if self.ask_yes_no('Do you really want to exit ([y]/n)?','y','n'): self.ask_exit() else: self.ask_exit()