##// END OF EJS Templates
Deprecated the module IPython.utils.warn
Pierre Gerold -
Show More
@@ -12,6 +12,9 b' import sys'
12
12
13 from IPython.utils import io
13 from IPython.utils import io
14
14
15 from warning import warn
16
17 warn("The module IPython.utils.warn is deprecated, use the standard warnings module instead", DeprecationWarning)
15
18
16 def warn(msg,level=2,exit_val=1):
19 def warn(msg,level=2,exit_val=1):
17 """Standard warning printer. Gives formatting consistency.
20 """Standard warning printer. Gives formatting consistency.
@@ -29,7 +32,8 b' def warn(msg,level=2,exit_val=1):'
29
32
30 -exit_val (1): exit value returned by sys.exit() for a level 4
33 -exit_val (1): exit value returned by sys.exit() for a level 4
31 warning. Ignored for all other levels."""
34 warning. Ignored for all other levels."""
32
35
36 warn("The module IPython.utils.warn is deprecated, use the standard warnings module instead", DeprecationWarning)
33 if level>0:
37 if level>0:
34 header = ['','','WARNING: ','ERROR: ','FATAL ERROR: ']
38 header = ['','','WARNING: ','ERROR: ','FATAL ERROR: ']
35 print(header[level], msg, sep='', file=io.stderr)
39 print(header[level], msg, sep='', file=io.stderr)
@@ -54,4 +58,3 b' def fatal(msg,exit_val=1):'
54 """Equivalent to warn(msg,exit_val=exit_val,level=4)."""
58 """Equivalent to warn(msg,exit_val=exit_val,level=4)."""
55
59
56 warn(msg,exit_val=exit_val,level=4)
60 warn(msg,exit_val=exit_val,level=4)
57
General Comments 0
You need to be logged in to leave comments. Login now