diff options
author | Nikita Slyusarev <nslus@yandex-team.com> | 2022-02-10 16:46:53 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:53 +0300 |
commit | 469afdc4e2587bf62ecdd096b75a0baa444c4012 (patch) | |
tree | 49e222ea1c5804306084bb3ae065bb702625360f /contrib/python/ipython/py2/IPython/utils/warn.py | |
parent | cd77cecfc03a3eaf87816af28a33067c4f0cdb59 (diff) | |
download | ydb-469afdc4e2587bf62ecdd096b75a0baa444c4012.tar.gz |
Restoring authorship annotation for Nikita Slyusarev <nslus@yandex-team.com>. Commit 2 of 2.
Diffstat (limited to 'contrib/python/ipython/py2/IPython/utils/warn.py')
-rw-r--r-- | contrib/python/ipython/py2/IPython/utils/warn.py | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/contrib/python/ipython/py2/IPython/utils/warn.py b/contrib/python/ipython/py2/IPython/utils/warn.py index ae5424a038..dd4852227b 100644 --- a/contrib/python/ipython/py2/IPython/utils/warn.py +++ b/contrib/python/ipython/py2/IPython/utils/warn.py @@ -9,17 +9,17 @@ Utilities for warnings. Shoudn't we just use the built in warnings module. from __future__ import print_function import sys -import warnings +import warnings -warnings.warn("The module IPython.utils.warn is deprecated since IPython 4.0, use the standard warnings module instead", DeprecationWarning) +warnings.warn("The module IPython.utils.warn is deprecated since IPython 4.0, use the standard warnings module instead", DeprecationWarning) def warn(msg,level=2,exit_val=1): - """Deprecated + """Deprecated + + Standard warning printer. Gives formatting consistency. - Standard warning printer. Gives formatting consistency. + Output is sent to sys.stderr. - Output is sent to sys.stderr. - Options: -level(2): allows finer control: @@ -31,35 +31,35 @@ def warn(msg,level=2,exit_val=1): -exit_val (1): exit value returned by sys.exit() for a level 4 warning. Ignored for all other levels.""" - - warnings.warn("The module IPython.utils.warn is deprecated since IPython 4.0, use the standard warnings module instead", DeprecationWarning) + + warnings.warn("The module IPython.utils.warn is deprecated since IPython 4.0, use the standard warnings module instead", DeprecationWarning) if level>0: header = ['','','WARNING: ','ERROR: ','FATAL ERROR: '] - print(header[level], msg, sep='', file=sys.stderr) + print(header[level], msg, sep='', file=sys.stderr) if level == 4: - print('Exiting.\n', file=sys.stderr) + print('Exiting.\n', file=sys.stderr) sys.exit(exit_val) def info(msg): - """Deprecated - - Equivalent to warn(msg,level=1).""" + """Deprecated + + Equivalent to warn(msg,level=1).""" warn(msg,level=1) def error(msg): - """Deprecated - - Equivalent to warn(msg,level=3).""" + """Deprecated + + Equivalent to warn(msg,level=3).""" warn(msg,level=3) def fatal(msg,exit_val=1): - """Deprecated - - Equivalent to warn(msg,exit_val=exit_val,level=4).""" + """Deprecated + + Equivalent to warn(msg,exit_val=exit_val,level=4).""" warn(msg,exit_val=exit_val,level=4) |