o
    &h	                     @   sl   d Z ddlZddlZddlZddlZddlZddgZejdedd da	dd	 Z
d
d Zdd Zdd ZdS )a  Signals.py -- dump a python stacktrace if something bad happens.

          DO NOT USE THIS MODULE IN PRODUCTION CODE

This module has two functions in its public API:

- dumpStackOnFatalSignal()
  This function will install signal handlers that print a stacktrace and
  then reraise the signal.

- resetFatalSignals()
  Restores the signal handlers to the state they had before the call to
  dumpStackOnFatalSignal.

This module is not designed to provide fine grained control over signal
handling. Nor is it intended to be terribly robust. It may give useful
information when your program gets unexpected signals, but it might just
as easily cause a crash when such a signal gets in.

          DO NOT USE THIS MODULE IN PRODUCTION CODE
    NdumpStackOnFatalSignalresetFatalSignalszAPyObjCTools.Signals is deprecated and will be removed in PyObjC 9   )
stacklevelc                 C   sD   t   td|  tjd t| tdtjd tt |  dS )ze
    the signal handler used in this module: print a stacktrace and
    then re-raise the signal
    z*** Handling fatal signal '%d'.)filez&*** Restored handlers and resignaling.N)	r   printsysstderr	tracebackprint_stackoskillgetpid)signumframe r   j/Users/merlin/projects/employee-monitoring-system/venv/lib/python3.10/site-packages/PyObjCTools/Signals.pydumpHandler)   s
   
r   c                 C   s   t  | tt| < dS )zk
    Install our signal handler for a signal. The original handler
    is saved in 'originalHandlers'.
    N)signalr   originalHandlerssigr   r   r   installHandler5   s   r   c                   C   sj   t s3i a ttj ttj ttj ttj ttj ttj ttj	 ttj
 ttj dS dS )z
    Install signal handlers that might print a useful stack trace when
    this process receives a fatal signal.

    NOTE: See module docstring
    N)r   r   r   SIGQUITSIGILLSIGTRAPSIGABRTSIGEMTSIGFPESIGBUSSIGSEGVSIGSYSr   r   r   r   r   =   s   	







c                  C   s*   t rt D ]
} t| t |   qda dS dS )z.
    Restore the original signal handlers
    N)r   r   r   r   r   r   r   S   s
   )__doc__r   r   r
   warningsr   __all__warnDeprecationWarningr   r   r   r   r   r   r   r   r   <module>   s"    