Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ef5c26c

Browse files
committed
Turn warning into error as marked in the warning message.
1 parent 6f69404 commit ef5c26c

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

IPython/terminal/embed.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ def __init__(self, **kw):
8989

9090

9191
if kw.get('user_global_ns', None) is not None:
92-
warnings.warn("user_global_ns has been replaced by user_module. The\
93-
parameter will be ignored, and removed in IPython 5.0", DeprecationWarning)
92+
raise DeprecationWarning("Key word argument `user_global_ns` has been replaced by `user_module` since IPython 4.0.")
9493

9594
self._call_location_id = kw.pop('_call_location_id', None)
9695

IPython/utils/warn.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import sys
1212
import warnings
1313

14-
warnings.warn("The module IPython.utils.warn is deprecated, use the standard warnings module instead", DeprecationWarning)
14+
warnings.warn("The module IPython.utils.warn is deprecated since IPython 4.0, use the standard warnings module instead", DeprecationWarning)
1515

1616
def warn(msg,level=2,exit_val=1):
1717
"""Standard warning printer. Gives formatting consistency.
@@ -30,7 +30,7 @@ def warn(msg,level=2,exit_val=1):
3030
-exit_val (1): exit value returned by sys.exit() for a level 4
3131
warning. Ignored for all other levels."""
3232

33-
warnings.warn("The module IPython.utils.warn is deprecated, use the standard warnings module instead", DeprecationWarning)
33+
warnings.warn("The module IPython.utils.warn is deprecated since IPython 4.0, use the standard warnings module instead", DeprecationWarning)
3434
if level>0:
3535
header = ['','','WARNING: ','ERROR: ','FATAL ERROR: ']
3636
print(header[level], msg, sep='', file=sys.stderr)

0 commit comments

Comments
 (0)