@@ -354,9 +354,10 @@ def _exiter_default(self):
354354 @observe ('prompt_in1' , 'prompt_in2' , 'prompt_out' , 'prompt_pad_left' )
355355 def _prompt_trait_changed (self , change ):
356356 name = change ['name' ]
357- warn ("InteractiveShell.{name} is deprecated since IPython 4.0 and ignored since 5.0, set TerminalInteractiveShell.prompts object directly." .format (
358- name = name )
359- )
357+ warn ("InteractiveShell.{name} is deprecated since IPython 4.0"
358+ " and ignored since 5.0, set TerminalInteractiveShell.prompts"
359+ " object directly." .format (name = name ))
360+
360361 # protect against weird cases where self.config may not exist:
361362
362363 show_rewritten_input = Bool (True ,
@@ -811,7 +812,7 @@ def set_hook(self,name,hook, priority=50, str_key=None, re_key=None,
811812
812813 if _warn_deprecated and (name in IPython .core .hooks .deprecated ):
813814 alternative = IPython .core .hooks .deprecated [name ]
814- warn ("Hook {} is deprecated. Use {} instead." .format (name , alternative ))
815+ warn ("Hook {} is deprecated. Use {} instead." .format (name , alternative ), stacklevel = 2 )
815816
816817 if not dp :
817818 dp = IPython .core .hooks .CommandChainDispatcher ()
@@ -839,7 +840,7 @@ def register_post_execute(self, func):
839840 Register a function for calling after code execution.
840841 """
841842 warn ("ip.register_post_execute is deprecated, use "
842- "ip.events.register('post_run_cell', func) instead." )
843+ "ip.events.register('post_run_cell', func) instead." , stacklevel = 2 )
843844 self .events .register ('post_run_cell' , func )
844845
845846 def _clear_warning_registry (self ):
0 commit comments