##// END OF EJS Templates
Fix interact() and mainloop() for backward compat.
Matthias Bussonnier -
Show More
@@ -35,6 +35,8 b' from .pt_inputhooks import get_inputhook_func'
35 from .prompts import Prompts, ClassicPrompts, RichPromptDisplayHook
35 from .prompts import Prompts, ClassicPrompts, RichPromptDisplayHook
36 from .ptutils import IPythonPTCompleter, IPythonPTLexer
36 from .ptutils import IPythonPTCompleter, IPythonPTLexer
37
37
38 DISPLAY_BANNER_DEPRECATED = object()
39
38
40
39 def get_default_editor():
41 def get_default_editor():
40 try:
42 try:
@@ -455,7 +457,11 b' class TerminalInteractiveShell(InteractiveShell):'
455 self.pt_cli.application.buffer.text = cast_unicode_py2(self.rl_next_input)
457 self.pt_cli.application.buffer.text = cast_unicode_py2(self.rl_next_input)
456 self.rl_next_input = None
458 self.rl_next_input = None
457
459
458 def interact(self):
460 def interact(self, display_banner=DISPLAY_BANNER_DEPRECATED):
461
462 if display_banner is not DISPLAY_BANNER_DEPRECATED:
463 warn('interact `display_banner` argument is deprecated since IPython 5.0. Call `show_banner()` if needed.', DeprecationWarning, stacklevel=2)
464
459 while self.keep_running:
465 while self.keep_running:
460 print(self.separate_in, end='')
466 print(self.separate_in, end='')
461
467
@@ -472,9 +478,11 b' class TerminalInteractiveShell(InteractiveShell):'
472 if self.autoedit_syntax and self.SyntaxTB.last_syntax_error:
478 if self.autoedit_syntax and self.SyntaxTB.last_syntax_error:
473 self.edit_syntax_error()
479 self.edit_syntax_error()
474
480
475 def mainloop(self):
481 def mainloop(self, display_banner=DISPLAY_BANNER_DEPRECATED):
476 # An extra layer of protection in case someone mashing Ctrl-C breaks
482 # An extra layer of protection in case someone mashing Ctrl-C breaks
477 # out of our internal code.
483 # out of our internal code.
484 if display_banner is not DISPLAY_BANNER_DEPRECATED:
485 warn('mainloop `display_banner` argument is deprecated since IPython 5.0. Call `show_banner()` if needed.', DeprecationWarning, stacklevel=2)
478 while True:
486 while True:
479 try:
487 try:
480 self.interact()
488 self.interact()
General Comments 0
You need to be logged in to leave comments. Login now