d Z ddlZddlmZ ddlmZ ddlmZ d Zde fdZ
de fd Zde fd
Z e e de dS )a
Astroid hooks for the signal library.
The signal module generates the 'Signals', 'Handlers' and 'Sigmasks' IntEnums
dynamically using the IntEnum._convert() classmethod, which modifies the module
globals. Astroid is unable to handle this type of code.
Without these hooks, the following are erroneously triggered by Pylint:
* E1101: Module 'signal' has no 'Signals' member (no-member)
* E1101: Module 'signal' has no 'Handlers' member (no-member)
* E1101: Module 'signal' has no 'Sigmasks' member (no-member)
These enums are defined slightly differently depending on the user's operating
system and platform. These platform differences should follow the current
Python typeshed stdlib `signal.pyi` stub file, available at:
* https://github.com/python/typeshed/blob/master/stdlib/signal.pyi
Note that the enum.auto() values defined here for the Signals, Handlers and
Sigmasks IntEnums are just dummy integer values, and do not correspond to the
actual standard signal numbers - which may vary depending on the system.
N)register_module_extender)parse)AstroidManagerc t t t t z t z S )zDGenerates the AST for 'Signals', 'Handlers' and 'Sigmasks' IntEnums.)r
_signals_enum_handlers_enum_sigmasks_enum l/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/astroid/brain/brain_signal.py_signals_enums_transformr
# s* >#3#33n6F6FFGGGr returnc d} t j dk r| dz
} t j dk r| dz
} t j dvr| dz
} | S )z3Generates the source code for the Signals int enum.a6
import enum
class Signals(enum.IntEnum):
SIGABRT = enum.auto()
SIGEMT = enum.auto()
SIGFPE = enum.auto()
SIGILL = enum.auto()
SIGINFO = enum.auto()
SIGINT = enum.auto()
SIGSEGV = enum.auto()
SIGTERM = enum.auto()
win32a
SIGALRM = enum.auto()
SIGBUS = enum.auto()
SIGCHLD = enum.auto()
SIGCONT = enum.auto()
SIGHUP = enum.auto()
SIGIO = enum.auto()
SIGIOT = enum.auto()
SIGKILL = enum.auto()
SIGPIPE = enum.auto()
SIGPROF = enum.auto()
SIGQUIT = enum.auto()
SIGSTOP = enum.auto()
SIGSYS = enum.auto()
SIGTRAP = enum.auto()
SIGTSTP = enum.auto()
SIGTTIN = enum.auto()
SIGTTOU = enum.auto()
SIGURG = enum.auto()
SIGUSR1 = enum.auto()
SIGUSR2 = enum.auto()
SIGVTALRM = enum.auto()
SIGWINCH = enum.auto()
SIGXCPU = enum.auto()
SIGXFSZ = enum.auto()
z)
SIGBREAK = enum.auto()
)darwinr z
SIGCLD = enum.auto()
SIGPOLL = enum.auto()
SIGPWR = enum.auto()
SIGRTMAX = enum.auto()
SIGRTMIN = enum.auto()
sysplatform)signals_enums r r r ( sl L |w 4 |w |... r c dS )z4Generates the source code for the Handlers int enum.zs
import enum
class Handlers(enum.IntEnum):
SIG_DFL = enum.auto()
SIG_IGN = eunm.auto()
r
r
r r r r ` s r c * t j dk rdS dS )z4Generates the source code for the Sigmasks int enum.r z
import enum
class Sigmasks(enum.IntEnum):
SIG_BLOCK = enum.auto()
SIG_UNBLOCK = enum.auto()
SIG_SETMASK = enum.auto()
r r
r r r r j s
|w 2r signal)
__doc__r astroid.brain.helpersr astroid.builderr astroid.managerr r
strr r r r
r r