diff options
author | Nikita Slyusarev <nslus@yandex-team.com> | 2022-02-10 16:46:52 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:52 +0300 |
commit | cd77cecfc03a3eaf87816af28a33067c4f0cdb59 (patch) | |
tree | 1308e0bae862d52e0020d881fe758080437fe389 /contrib/python/ipython/py2/IPython/utils/warn.py | |
parent | cdae02d225fb5b3afbb28990e79a7ac6c9125327 (diff) | |
download | ydb-cd77cecfc03a3eaf87816af28a33067c4f0cdb59.tar.gz |
Restoring authorship annotation for Nikita Slyusarev <nslus@yandex-team.com>. Commit 1 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 dd4852227b..ae5424a038 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 - - Standard warning printer. Gives formatting consistency. + """Deprecated - Output is sent to sys.stderr. + Standard warning printer. Gives formatting consistency. + 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) |