Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a128677

Browse files
author
Yuri Numerov
committed
fixed exit confirmation glitch
1 parent d9e34f8 commit a128677

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

IPython/core/interactiveshell.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3252,10 +3252,10 @@ def write_err(self,data):
32523252
"""Write a string to the default error output"""
32533253
io.stderr.write(data)
32543254

3255-
def ask_yes_no(self, prompt, default=None):
3255+
def ask_yes_no(self, prompt, default=None, interrupt=None):
32563256
if self.quiet:
32573257
return True
3258-
return ask_yes_no(prompt,default)
3258+
return ask_yes_no(prompt,default,interrupt)
32593259

32603260
def show_usage(self):
32613261
"""Show a usage message"""

IPython/terminal/interactiveshell.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ def exit(self):
617617
618618
This method calls the ask_exit callback."""
619619
if self.confirm_exit:
620-
if self.ask_yes_no('Do you really want to exit ([y]/n)?','y'):
620+
if self.ask_yes_no('Do you really want to exit ([y]/n)?','y','n'):
621621
self.ask_exit()
622622
else:
623623
self.ask_exit()

0 commit comments

Comments
 (0)