ó
    áÅŸg½  ã                  ó:  • S SK Jr  S SKrS SKrS SKJr  S SKJr  S SKJr  S SKJ	r	  S SKJ
r
  S SKrS SKr\
(       a  S SKJr   " S	 S
5      rSS jr\R"                  " SSS9SS j5       r\R"                  " SSS9SS j5       r\R"                  " SSS9SS j5       rg)é    )ÚannotationsN)ÚTracebackType)ÚAny)ÚCallable)Ú	Generator)ÚTYPE_CHECKING)ÚSelfc                  óP   • \ rS rSrSrS	S jrS
S jrSS jr        SS jrSr	g)Úcatch_threading_exceptioné   a¡  Context manager catching threading.Thread exception using
threading.excepthook.

Storing exc_value using a custom hook can create a reference cycle. The
reference cycle is broken explicitly when the context manager exits.

Storing thread using a custom hook can resurrect it if it is set to an
object which is being finalized. Exiting the context manager clears the
stored object.

Usage:
    with threading_helper.catch_threading_exception() as cm:
        # code spawning a thread which raises an exception
        ...
        # check the thread exception: use cm.args
        ...
    # cm.args attribute no longer exists at this point
    # (to break a reference cycle)
c                ó    • S U l         S U l        g ©N)ÚargsÚ	_old_hook©Úselfs    ÚX/var/www/blue/EV-Temp_rev04/venv/lib/python3.13/site-packages/_pytest/threadexception.pyÚ__init__Ú"catch_threading_exception.__init__)   s   € Ø59ˆŒ	ØKOˆ�ó    c                ó   • Xl         g r   )r   )r   r   s     r   Ú_hookÚcatch_threading_exception._hook-   s   € Ø�	r   c                óZ   • [         R                  U l        U R                  [         l        U $ r   )Ú	threadingÚ
excepthookr   r   r   s    r   Ú	__enter__Ú#catch_threading_exception.__enter__0   s    € Ü"×-Ñ-ˆŒØ#Ÿz™zŒ	ÔØˆr   c                ó^   • U R                   c   eU R                   [        l        S U l         U ?g r   )r   r   r   r   )r   Úexc_typeÚexc_valÚexc_tbs       r   Ú__exit__Ú"catch_threading_exception.__exit__5   s,   € ð �~‰~Ñ)Ð)Ð)Ø#Ÿ~™~Œ	ÔØˆŒØ‰Ir   )r   r   N)ÚreturnÚNone)r   zthreading.ExceptHookArgsr%   r&   )r%   r	   )r    ztype[BaseException] | Noner!   zBaseException | Noner"   zTracebackType | Noner%   r&   )
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r   r#   Ú__static_attributes__© r   r   r   r      sB   † ñô(Pôôð
	à,ð	ð &ð	ð %ð		ð
 
÷	r   r   c               #  óê  #   • [        5        n  S v •  U R                  (       aÏ  U R                  R                  c  SOU R                  R                  R                  nSU S3nUSR	                  [
        R                  " U R                  R                  U R                  R                  U R                  R                  5      5      -  n[        R                  " [        R                  " U5      5        S S S 5        g ! U R                  (       aÐ  U R                  R                  c  SOU R                  R                  R                  nSU S3nUSR	                  [
        R                  " U R                  R                  U R                  R                  U R                  R                  5      5      -  n[        R                  " [        R                  " U5      5        f f = f! , (       d  f       g = f7f)Nz	<unknown>zException in thread z

Ú )r   r   ÚthreadÚnameÚjoinÚ	tracebackÚformat_exceptionr    Ú	exc_valueÚexc_tracebackÚwarningsÚwarnÚpytestÚ%PytestUnhandledThreadExceptionWarning)ÚcmÚthread_nameÚmsgs      r   Úthread_exception_runtest_hookr>   A   sm  é € Ü	"Ô	$¨ð	QÛà�w�wà#%§7¡7§>¡>Ñ#9‘K¸r¿w¹w¿~¹~×?RÑ?Rð ð -¨[¨M¸Ð>�Ø�r—w‘wÜ×.Ò.ØŸ™×(Ñ(ØŸ™×)Ñ)ØŸ™×-Ñ-óóñ �ô —’œf×JÒJÈ3ÓOÔP÷! 
%Ð	$øð �w�wà#%§7¡7§>¡>Ñ#9‘K¸r¿w¹w¿~¹~×?RÑ?Rð ð -¨[¨M¸Ð>�Ø�r—w‘wÜ×.Ò.ØŸ™×(Ñ(ØŸ™×)Ñ)ØŸ™×-Ñ-óóñ �ô —’œf×JÒJÈ3ÓOÕPð ú÷	 
%Õ	$üs4   ‚G3�G"�C<“C G"Ã3	G3Ã<C#GÇG"Ç"
G0Ç,G3T)ÚwrapperÚtrylastc               #  ó4   #   • [        5        S h  v•N   g  N7fr   ©r>   r-   r   r   Úpytest_runtest_setuprC   U   ó   é € ä,Ó.×.Ó.ùó   ‚�‘)r?   Útryfirstc               #  ó4   #   • [        5        S h  v•N   g  N7fr   rB   r-   r   r   Úpytest_runtest_callrH   Z   rD   rE   c               #  ó4   #   • [        5        S h  v•N   g  N7fr   rB   r-   r   r   Úpytest_runtest_teardownrJ   _   rD   rE   )r%   zGenerator[None])Ú
__future__r   r   r3   Útypesr   Útypingr   r   r   r   r7   r9   Útyping_extensionsr	   r   r>   ÚhookimplrC   rH   rJ   r-   r   r   Ú<module>rP      s™   ðÝ "ã Û Ý Ý Ý Ý Ý  Û ã ö Ý&÷*ñ *ôZQð( ‡‚˜ tÑ,ó/ó -ð/ð ‡‚˜¨Ñ-ó/ó .ð/ð ‡‚˜¨Ñ-ó/ó .ñ/r   