##// END OF EJS Templates
register default deprecation warning filter....
Matthias Bussonnier -
Show More
@@ -25,6 +25,7 b' import tempfile'
25 25 import traceback
26 26 import types
27 27 import subprocess
28 import warnings
28 29 from io import open as io_open
29 30
30 31 from pickleshare import PickleShareDB
@@ -547,6 +548,7 b' class InteractiveShell(SingletonConfigurable):'
547 548 self.init_pdb()
548 549 self.init_extension_manager()
549 550 self.init_payload()
551 self.init_deprecation_warnings()
550 552 self.hooks.late_startup_hook()
551 553 self.events.trigger('shell_initialized', self)
552 554 atexit.register(self.atexit_operations)
@@ -663,6 +665,18 b' class InteractiveShell(SingletonConfigurable):'
663 665 elif self.logstart:
664 666 self.magic('logstart')
665 667
668 @staticmethod
669 def init_deprecation_warnings():
670 """
671 register default filter for (pending) deprecation warning.
672
673 This will allow deprecation warning of function used interactively to show
674 warning to users, and still hide deprecation warning from libraries import.
675 """
676 warnings.filterwarnings("default", category=DeprecationWarning, module="__main__")
677 warnings.filterwarnings("default", category=PendingDeprecationWarning, module="__main__")
678
679
666 680 def init_builtins(self):
667 681 # A single, static flag that we set to True. Its presence indicates
668 682 # that an IPython shell has been created, and we make no attempts at
General Comments 0
You need to be logged in to leave comments. Login now