Current File : //proc/self/root/usr/local/lib/python3.6/site-packages/ptrace/__pycache__/signames.cpython-36.pyc
3

�d��@s"dZd
Zdd�Ze�Zdd�Zd	S)z�
Name of process signals.

SIGNAMES contains a dictionary mapping a signal number to it's name. But you
should better use signalName() instead of SIGNAMES since it returns a string
even if the signal is unknown.
�SIGABRT�SIGHUP�SIGCHLD�SIGPOLLcCs�ddl}i}xXt|�D]L}|jd�s&qt||�}y||j|�Wqtk
r`|g||<YqXqWi}xN|j�D]B\}}|s�qtd}xtD]}||kr�|}Pq�W|s�|d}|||<qtW|S)z�
    Create signal names dictionary (e.g. 9 => 'SIGKILL') using dir(signal).
    If multiple signal names have the same number, use the first matching name
    in PREFERRED_NAME to select preferred name (e.g. SIGIOT=SIGABRT=17).
    �NZSIG)�signal�dir�
startswith�getattr�append�KeyError�items�PREFERRED_NAMES)rZallnames�name�signumZsignames�names�	preferred�r�8/tmp/pip-build-in2aja_b/python-ptrace/ptrace/signames.py�getSignalNamess.


rcCs&yt|Stk
r d|SXdS)z�
    Get the name of a signal

    >>> from signal import SIGINT
    >>> signalName(SIGINT)
    'SIGINT'
    >>> signalName(404)
    'signal<404>'
    z
signal<%s>N)�SIGNAMESr)rrrr�
signalName/s
rN)rrrr)�__doc__r
rrrrrrr�<module>s