From 30385c4ef55446d7213fd0da7a8ee35e39127bb7 2011-11-21 23:57:08 From: MinRK Date: 2011-11-21 23:57:08 Subject: [PATCH] fix default value in interactiveshell.ask_yes_no was True, should be None closes #1026 --- diff --git a/IPython/core/interactiveshell.py b/IPython/core/interactiveshell.py index eea851c..39fc975 100644 --- a/IPython/core/interactiveshell.py +++ b/IPython/core/interactiveshell.py @@ -2616,7 +2616,7 @@ class InteractiveShell(SingletonConfigurable, Magic): """Write a string to the default error output""" io.stderr.write(data) - def ask_yes_no(self,prompt,default=True): + def ask_yes_no(self, prompt, default=None): if self.quiet: return True return ask_yes_no(prompt,default) diff --git a/IPython/core/magic.py b/IPython/core/magic.py index 0785691..b63ce9c 100644 --- a/IPython/core/magic.py +++ b/IPython/core/magic.py @@ -1058,7 +1058,8 @@ Currently the magic system has the following functions:\n""" ans = True else: ans = self.shell.ask_yes_no( - "Once deleted, variables cannot be recovered. Proceed (y/[n])? ") + "Once deleted, variables cannot be recovered. Proceed (y/[n])? ", + default='n') if not ans: print 'Nothing done.' return