diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
commit | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch) | |
tree | 012bb94d777798f1f56ac1cec429509766d05181 /contrib/tools/python3/src/Lib/signal.py | |
parent | 6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff) | |
download | ydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/tools/python3/src/Lib/signal.py')
-rw-r--r-- | contrib/tools/python3/src/Lib/signal.py | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/contrib/tools/python3/src/Lib/signal.py b/contrib/tools/python3/src/Lib/signal.py index 50b215b29d..fbb0b5b19e 100644 --- a/contrib/tools/python3/src/Lib/signal.py +++ b/contrib/tools/python3/src/Lib/signal.py @@ -4,19 +4,19 @@ from enum import IntEnum as _IntEnum _globals = globals() -_IntEnum._convert_( +_IntEnum._convert_( 'Signals', __name__, lambda name: name.isupper() and (name.startswith('SIG') and not name.startswith('SIG_')) or name.startswith('CTRL_')) -_IntEnum._convert_( +_IntEnum._convert_( 'Handlers', __name__, lambda name: name in ('SIG_DFL', 'SIG_IGN')) if 'pthread_sigmask' in _globals: - _IntEnum._convert_( + _IntEnum._convert_( 'Sigmasks', __name__, lambda name: name in ('SIG_BLOCK', 'SIG_UNBLOCK', 'SIG_SETMASK')) @@ -41,16 +41,16 @@ def _enum_to_int(value): return value -# Similar to functools.wraps(), but only assign __doc__. -# __module__ should be preserved, -# __name__ and __qualname__ are already fine, -# __annotations__ is not set. -def _wraps(wrapped): - def decorator(wrapper): - wrapper.__doc__ = wrapped.__doc__ - return wrapper - return decorator - +# Similar to functools.wraps(), but only assign __doc__. +# __module__ should be preserved, +# __name__ and __qualname__ are already fine, +# __annotations__ is not set. +def _wraps(wrapped): + def decorator(wrapper): + wrapper.__doc__ = wrapped.__doc__ + return wrapper + return decorator + @_wraps(_signal.signal) def signal(signalnum, handler): handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler)) @@ -73,7 +73,7 @@ if 'pthread_sigmask' in _globals: if 'sigpending' in _globals: @_wraps(_signal.sigpending) def sigpending(): - return {_int_to_enum(x, Signals) for x in _signal.sigpending()} + return {_int_to_enum(x, Signals) for x in _signal.sigpending()} if 'sigwait' in _globals: @@ -82,11 +82,11 @@ if 'sigwait' in _globals: retsig = _signal.sigwait(sigset) return _int_to_enum(retsig, Signals) - -if 'valid_signals' in _globals: - @_wraps(_signal.valid_signals) - def valid_signals(): - return {_int_to_enum(x, Signals) for x in _signal.valid_signals()} - - + +if 'valid_signals' in _globals: + @_wraps(_signal.valid_signals) + def valid_signals(): + return {_int_to_enum(x, Signals) for x in _signal.valid_signals()} + + del _globals, _wraps |