ó
    »ö‘jp
  ã                  ó4   • S SK Jr  S SKrS SKr " S S5      rg)é    )ÚannotationsNc                  ó€   • \ rS rSrSrSr\44S jrS r\	S 5       r
\	S 5       r\	S 5       rS	 rS
 r\S.S jrS rSrg)ÚExceptionTrapé   aA  
A context manager that will catch certain exceptions and provide an
indication they occurred.

>>> with ExceptionTrap() as trap:
...     raise Exception()
>>> bool(trap)
True

>>> with ExceptionTrap() as trap:
...     pass
>>> bool(trap)
False

>>> with ExceptionTrap(ValueError) as trap:
...     raise ValueError("1 + 1 is not 3")
>>> bool(trap)
True
>>> trap.value
ValueError('1 + 1 is not 3')
>>> trap.tb
<traceback object at ...>

>>> with ExceptionTrap(ValueError) as trap:
...     raise Exception()
Traceback (most recent call last):
...
Exception

>>> bool(trap)
False
)NNNc                ó   • Xl         g ©N)Ú
exceptions)Úselfr	   s     Ú©C:\Users\johnn\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\importlib_metadata/_context.pyÚ__init__ÚExceptionTrap.__init__,   s   € Ø$�ó    c                ó   • U $ r   © ©r
   s    r   Ú	__enter__ÚExceptionTrap.__enter__/   s   € Øˆr   c                ó    • U R                   S   $ ©Nr   ©Úexc_infor   s    r   ÚtypeÚExceptionTrap.type2   ó   € à�}‰}˜QÑÐr   c                ó    • U R                   S   $ )Né   r   r   s    r   ÚvalueÚExceptionTrap.value6   r   r   c                ó    • U R                   S   $ )Né   r   r   s    r   ÚtbÚExceptionTrap.tb:   r   r   c                óf   • US   nU=(       a    [        X R                  5      nU(       a  Xl        U$ r   )Ú
issubclassr	   r   )r
   r   r   Úmatchess       r   Ú__exit__ÚExceptionTrap.__exit__>   s+   € Ø˜‰{ˆØ×<œ: d¯O©OÓ<ˆÞØ$ŒMØˆr   c                ó,   • [        U R                  5      $ r   )Úboolr   r   s    r   Ú__bool__ÚExceptionTrap.__bool__E   s   € Ü�D—I‘I‹Ðr   ©Ú_testc               óN   ^ ^^• [         R                  " T5      UUU 4S j5       nU$ )aQ  
Wrap func and replace the result with the truth
value of the trap (True if an exception occurred).

First, give the decorator an alias to support Python 3.8
Syntax.

>>> raises = ExceptionTrap(ValueError).raises

Now decorate a function that always fails.

>>> @raises
... def fail():
...     raise ValueError('failed')
>>> fail()
True
c                 ó‚   >• [        TR                  5       nT" U 0 UD6  S S S 5        T" W5      $ ! , (       d  f       N= fr   )r   r	   )ÚargsÚkwargsÚtrapr-   Úfuncr
   s      €€€r   ÚwrapperÚ%ExceptionTrap.raises.<locals>.wrapper[   s6   ø€ ä˜tŸ™Ô/°4Ù�dÐ%˜fÒ%÷ 0á˜“;Ð÷ 0Õ/ús   —	0°
>)Ú	functoolsÚwraps)r
   r3   r-   r4   s   ``` r   ÚraisesÚExceptionTrap.raisesH   s'   ú€ ô& 
�Š˜Ó	ö	ó 
ð	ð
 ˆr   c                ó>   • U R                  U[        R                  S9$ )aJ  
Wrap func and replace the result with the truth
value of the trap (True if no exception).

First, give the decorator an alias to support Python 3.8
Syntax.

>>> passes = ExceptionTrap(ValueError).passes

Now decorate a function that always fails.

>>> @passes
... def fail():
...     raise ValueError('failed')

>>> fail()
False
r,   )r8   ÚoperatorÚnot_)r
   r3   s     r   ÚpassesÚExceptionTrap.passesc   s   € ð& �{‰{˜4¤x§}¡}ˆ{Ð5Ð5r   )r   r	   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Ú	Exceptionr   r   Úpropertyr   r   r!   r&   r*   r)   r8   r=   Ú__static_attributes__r   r   r   r   r      ss   † ñðB  €Hà#, ,ô %òð ñ ó ð ð ñ ó ð ð ñ ó ð òòð %)õ õ66r   r   )Ú
__future__r   r6   r;   r   r   r   r   Ú<module>rH      s   ðÝ "ã Û ÷n6ò n6r   