Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../usr/lib64/python3....
File: signal.py
import _signal
[0] Fix | Delete
from _signal import *
[1] Fix | Delete
from functools import wraps as _wraps
[2] Fix | Delete
from enum import IntEnum as _IntEnum
[3] Fix | Delete
[4] Fix | Delete
_globals = globals()
[5] Fix | Delete
[6] Fix | Delete
_IntEnum._convert_(
[7] Fix | Delete
'Signals', __name__,
[8] Fix | Delete
lambda name:
[9] Fix | Delete
name.isupper()
[10] Fix | Delete
and (name.startswith('SIG') and not name.startswith('SIG_'))
[11] Fix | Delete
or name.startswith('CTRL_'))
[12] Fix | Delete
[13] Fix | Delete
_IntEnum._convert_(
[14] Fix | Delete
'Handlers', __name__,
[15] Fix | Delete
lambda name: name in ('SIG_DFL', 'SIG_IGN'))
[16] Fix | Delete
[17] Fix | Delete
if 'pthread_sigmask' in _globals:
[18] Fix | Delete
_IntEnum._convert_(
[19] Fix | Delete
'Sigmasks', __name__,
[20] Fix | Delete
lambda name: name in ('SIG_BLOCK', 'SIG_UNBLOCK', 'SIG_SETMASK'))
[21] Fix | Delete
[22] Fix | Delete
[23] Fix | Delete
def _int_to_enum(value, enum_klass):
[24] Fix | Delete
"""Convert a numeric value to an IntEnum member.
[25] Fix | Delete
If it's not a known member, return the numeric value itself.
[26] Fix | Delete
"""
[27] Fix | Delete
try:
[28] Fix | Delete
return enum_klass(value)
[29] Fix | Delete
except ValueError:
[30] Fix | Delete
return value
[31] Fix | Delete
[32] Fix | Delete
[33] Fix | Delete
def _enum_to_int(value):
[34] Fix | Delete
"""Convert an IntEnum member to a numeric value.
[35] Fix | Delete
If it's not an IntEnum member return the value itself.
[36] Fix | Delete
"""
[37] Fix | Delete
try:
[38] Fix | Delete
return int(value)
[39] Fix | Delete
except (ValueError, TypeError):
[40] Fix | Delete
return value
[41] Fix | Delete
[42] Fix | Delete
[43] Fix | Delete
@_wraps(_signal.signal)
[44] Fix | Delete
def signal(signalnum, handler):
[45] Fix | Delete
handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
[46] Fix | Delete
return _int_to_enum(handler, Handlers)
[47] Fix | Delete
[48] Fix | Delete
[49] Fix | Delete
@_wraps(_signal.getsignal)
[50] Fix | Delete
def getsignal(signalnum):
[51] Fix | Delete
handler = _signal.getsignal(signalnum)
[52] Fix | Delete
return _int_to_enum(handler, Handlers)
[53] Fix | Delete
[54] Fix | Delete
[55] Fix | Delete
if 'pthread_sigmask' in _globals:
[56] Fix | Delete
@_wraps(_signal.pthread_sigmask)
[57] Fix | Delete
def pthread_sigmask(how, mask):
[58] Fix | Delete
sigs_set = _signal.pthread_sigmask(how, mask)
[59] Fix | Delete
return set(_int_to_enum(x, Signals) for x in sigs_set)
[60] Fix | Delete
pthread_sigmask.__doc__ = _signal.pthread_sigmask.__doc__
[61] Fix | Delete
[62] Fix | Delete
[63] Fix | Delete
if 'sigpending' in _globals:
[64] Fix | Delete
@_wraps(_signal.sigpending)
[65] Fix | Delete
def sigpending():
[66] Fix | Delete
return {_int_to_enum(x, Signals) for x in _signal.sigpending()}
[67] Fix | Delete
[68] Fix | Delete
[69] Fix | Delete
if 'sigwait' in _globals:
[70] Fix | Delete
@_wraps(_signal.sigwait)
[71] Fix | Delete
def sigwait(sigset):
[72] Fix | Delete
retsig = _signal.sigwait(sigset)
[73] Fix | Delete
return _int_to_enum(retsig, Signals)
[74] Fix | Delete
sigwait.__doc__ = _signal.sigwait
[75] Fix | Delete
[76] Fix | Delete
[77] Fix | Delete
if 'valid_signals' in _globals:
[78] Fix | Delete
@_wraps(_signal.valid_signals)
[79] Fix | Delete
def valid_signals():
[80] Fix | Delete
return {_int_to_enum(x, Signals) for x in _signal.valid_signals()}
[81] Fix | Delete
[82] Fix | Delete
[83] Fix | Delete
del _globals, _wraps
[84] Fix | Delete
[85] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function