Skip to content

Commit

Permalink
Catch keyboard interrupt and quit
Browse files Browse the repository at this point in the history
  • Loading branch information
Carreau committed Dec 5, 2015
1 parent f7c53fd commit 51ca6ff
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions IPython/core/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,11 @@ def initialize_subcommand(self, subc, argv=None):
self.log.warning("Subcommand `ipython {sub}` is deprecated and will be removed "
"in future versions.".format(sub=subc))
self.log.warning("You likely want to use `jupyter {sub}`... continue "
"in 5 sec".format(sub=subc))
time.sleep(5)
"in 5 sec. Press Ctrl-C to quit now.".format(sub=subc))
try:
time.sleep(5)
except KeyboardInterrupt:
sys.exit(1)
return super(BaseIPythonApplication, self).initialize_subcommand(subc, argv)

def init_crash_handler(self):
Expand Down

0 comments on commit 51ca6ff

Please sign in to comment.