o
    &š£hÂ  ã                   @   s,   d Z ddlmZ ddgZdd„ Zdd„ ZdS )a0  
Substitute for the signal module when using a CFRunLoop.

This module is generally only used to support:
    PyObjCTools.AppHelper.installMachInterrupt()

A mach port is opened and registered to the CFRunLoop.
When a signal occurs the signal number is sent in a mach
message to the CFRunLoop.  The handler then causes Python
code to get executed.

In other words, Python's signal handling code does not wake
reliably when not running Python code, but this does.

Note that signals will only be processed while a Cocoa
run loop is running in the default mode.
é    )Ú_machsignalsÚ	getsignalÚsignalc                 C   s   t j | ¡S )z
    Return the signal handler for signal ``signum``. Returns ``None`` when
    there is no signal handler for the signal.
    )r   Ú_signalmappingÚget)Úsignum© r   ún/Users/merlin/projects/employee-monitoring-system/venv/lib/python3.10/site-packages/PyObjCTools/MachSignals.pyr      s   c                 C   s    t | ƒ}|tj| < t | ¡ |S )zÃ
    Install a new signal handler for ``signum``. Returns the old signal
    handler (``None`` when there is no previous handler.

    The handler should have one argument: the signal number
    )r   r   r   Zhandle_signal)r   ÚhandlerÚrvalr   r   r	   r       s   

N)Ú__doc__Úobjcr   Ú__all__r   r   r   r   r   r	   Ú<module>   s
    