
    L-Ph                     V    d Z ddlZddlZddlZdad Zd Zd Zi Zda	da
d Zd Zd	 ZdS )
as  Activate coverage at python startup if appropriate.

The python site initialisation will ensure that anything we import
will be removed and not visible at the end of python startup.  However
we minimise all work by putting these init actions in this separate
module and only importing what is needed when needed.

For normal python startup when coverage should not be activated the pth
file checks a single env var and does not import or call the init fn
here.

For python startup when an ancestor process has set the env indicating
that code coverage is being collected we activate coverage based on
info passed via env vars.
    Nc                     t           j                            d          } t           j                            d          }t           j                            d          }t           j                            d          dk    rdnd }t           j                            d          }|rt          rt	                       dd l}| t           j        v rd } n|                     t           j                  } |t           j        k    rd}|                    | |d|d|	          x}a|	                                 |
                                 |r|                    |           d
|_        d
|_        d
|_        |S d S )NCOV_CORE_SOURCECOV_CORE_CONFIGCOV_CORE_DATAFILECOV_CORE_BRANCHenabledTCOV_CORE_CONTEXTr   )sourcebranchdata_suffixconfig_file	auto_data	data_fileF)osenvironget_active_covcleanupcoveragepathsepsplitCoverageloadstartswitch_context_warn_no_data_warn_unimported_source_warn_preimported_source)
cov_source
cov_configcov_datafile
cov_branchcov_contextr   covs          P/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/pytest_cov/embed.pyinitr&      si   
  122J 122J:>>"566L(9::iGGTJ*..!344K  	III ##JJ#))"*55J##J %--"" . 
 
 	
k 	


		 	,{+++!&+#',$
=     c                     | \|                                   |                                  d| _        	 t          j        | j                   d S # t          $ r Y d S w xY wd S )NF)stopsave
_auto_saveatexit
unregister_atexit	Exception)r$   s    r%   _cleanupr0   D   so    






	ck***** 	 	 	DD	 s   A 
AAc                  p    da t          t                     d ada t          rt          } d at	          |   d S d S )NTF)_cleanup_in_progressr0   r   _pending_signal_signal_cleanup_handler)pending_signals    r%   r   r   O   sP    
  [K  1(00001 1r'   Fc                 F   t           r| |fad S t                       t                              |           }|t
          j        k    rd S |r|t          ur || |           d S | t
          j        k    rt          j
        d| z              d S | t
          j        k    rt          d S )N   )r2   r3   r   _previous_handlersr   signalSIG_IGNr4   SIGTERMr   _exitSIGINTKeyboardInterrupt)signumframe_previous_handlers      r%   r4   r4   c   s      %-III*..v66FN**	  08OOO&%(((((	6>	!	!
v	6=	 	  
!	 r'   c                     t          j        |           }|t          ur&|t          | <   t          j         | t                     d S d S N)r9   	getsignalr4   r8   )r?   previouss     r%   cleanup_on_signalrF   t   sJ    ''H...%-6"f566666 /.r'   c                  8    t          t          j                   d S rC   )rF   r9   r;    r'   r%   cleanup_on_sigtermrI   {   s    fn%%%%%r'   )__doc__r,   r   r9   r   r&   r0   r   r8   r3   r2   r4   rF   rI   rH   r'   r%   <module>rK      s       				 ) ) )X  1 1 1        "7 7 7& & & & &r'   