From 18d1281cd709ef1b636226a20f2db6321650345e 2016-07-01 16:08:48 From: Matthias Bussonnier Date: 2016-07-01 16:08:48 Subject: [PATCH] Typo + Add Warning class for deprecation. Also set the stack level to 2, to get the warning where the context manager is constructed, if used. --- diff --git a/IPython/core/completer.py b/IPython/core/completer.py index ba8cdcd..bb143b6 100644 --- a/IPython/core/completer.py +++ b/IPython/core/completer.py @@ -1,7 +1,7 @@ # encoding: utf-8 """Word completion for IPython. -This module stared as fork of the rlcompleter module in the Python standard +This module started as fork of the rlcompleter module in the Python standard library. The original enhancements made to rlcompleter have been sent upstream and were accepted as of Python 2.3, diff --git a/IPython/utils/contexts.py b/IPython/utils/contexts.py index 567a753..4d379b0 100644 --- a/IPython/utils/contexts.py +++ b/IPython/utils/contexts.py @@ -67,7 +67,8 @@ class NoOpContext(object): Context manager that does nothing.""" def __init__(self): - warnings.warn("""NoOpContext is deprecated since IPython 5.0 """) + warnings.warn("""NoOpContext is deprecated since IPython 5.0 """, + DeprecationWarning, stacklevel=2) def __enter__(self): pass def __exit__(self, type, value, traceback): pass