##// END OF EJS Templates
deprecated noop context managers
Matthias Bussonnier -
Show More
@@ -2,6 +2,8 b''
2 """Miscellaneous context managers.
2 """Miscellaneous context managers.
3 """
3 """
4
4
5 import warnings
6
5 # Copyright (c) IPython Development Team.
7 # Copyright (c) IPython Development Team.
6 # Distributed under the terms of the Modified BSD License.
8 # Distributed under the terms of the Modified BSD License.
7
9
@@ -59,6 +61,13 b' class preserve_keys(object):'
59
61
60
62
61 class NoOpContext(object):
63 class NoOpContext(object):
62 """Context manager that does nothing."""
64 """
65 Deprecated
66
67 Context manager that does nothing."""
68
69 def __init__(self):
70 warnings.warn("""NoOpContext is deprecated since IPython 5.0 """)
71
63 def __enter__(self): pass
72 def __enter__(self): pass
64 def __exit__(self, type, value, traceback): pass
73 def __exit__(self, type, value, traceback): pass
General Comments 0
You need to be logged in to leave comments. Login now