
    e\                     n    d Z ddlZddlmZ ddlmZ ddlmZ d Zde	fdZ
de	fd	Zde	fd
ZdeddfdZy)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     </usr/lib/python3/dist-packages/astroid/brain/brain_signal.py_signals_enums_transformr   #   s    >#33n6FFGGr   returnc                      d} t         j                  dk7  r| dz  } t         j                  dk(  r| dz  } t         j                  dvr| dz  } | 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()
        sysplatform)signals_enums    r   r   r   (   si    L ||w  	4 ||w  	 ||..  	 r   c                       y)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                  dk7  ryy)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 r   managerc                 &    t        | dt               y )Nsignal)r   r   )r   s    r   registerr   w   s    Wh0HIr   )__doc__r   astroid.brain.helpersr   astroid.builderr   astroid.managerr   r   strr   r   r	   r   r
   r   r   <module>r"      sY   
.  : ! *H
5s 5p 
 
Jn J Jr   