
    -Ph                       d Z ddlmZ ddlZddlZddlZddlZddlZddlZg dZ	ddZ
 G d d	e          Z G d
 de          Zej        dk    rej        Zn G d de          Zej         G d d                      ZdS )a  
This module defines exceptions and error handling utilities. It is the
recommend path to access ``ConfiguratonError``, ``ConfigurationWarning``, and
``ExceptionGroup``. For backward compatibility, ``ConfigurationError`` is
re-exported in the top-level package.
    )annotationsN)ConfigurationErrorConfigurationWarningExceptionGroupreturn	list[str]c                     t           S N)__all__     Y/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/pyproject_metadata/errors.py__dir__r      s    Nr   c                  B     e Zd ZdZddd fdZedd
            Z xZS )r   zError in the backend metadata. Has an optional key attribute, which will be non-None
    if the error is related to a single key in the pyproject.toml file.Nkeymsgstrr   
str | Nonec               X    t                                          |           || _        d S r
   )super__init___key)selfr   r   	__class__s      r   r   zConfigurationError.__init__"   s&    			r   r   c                    | j         S r
   )r   r   s    r   r   zConfigurationError.key&   s
    yr   )r   r   r   r   )r   r   )__name__
__module____qualname____doc__r   propertyr   __classcell__)r   s   @r   r   r      sx        K K 7;            X    r   r   c                      e Zd ZdZdS )r   z Warnings about backend metadata.N)r   r   r    r!   r   r   r   r   r   +   s        ****r   r   )      c                  8    e Zd ZU dZded<   ded<   ddZdd	Zd
S )r   aG  A minimal implementation of `ExceptionGroup` from Python 3.11.

        Users can replace this with a more complete implementation, such as from
        the exceptiongroup backport package, if better error messages and
        integration with tooling is desired and the addition of a dependency is
        acceptable.
        r   messagelist[Exception]
exceptionsr   Nonec                "    || _         || _        d S r
   )r(   r*   )r   r(   r*   s      r   r   zExceptionGroup.__init__?   s    "DL(DOOOr   c                @    | j         j         d| j        d| j        dS )N(z, ))r   r   r(   r*   r   s    r   __repr__zExceptionGroup.__repr__C   s*    n-VVVV$/VVVVr   N)r(   r   r*   r)   r   r+   )r   r   )r   r   r    r!   __annotations__r   r0   r   r   r   r   r   3   se         	 	 	####	) 	) 	) 	)	W 	W 	W 	W 	W 	Wr   r   c                      e Zd ZU dZded<    ej        e          Zded<   ddddd	ddZ	ddZ
ej        dd            ZdS )ErrorCollectorz
    Collect errors and raise them as a group at the end (if collect_errors is True),
    otherwise raise them immediately.
    boolcollect_errors)default_factoryr)   errorsNF)r   gotgot_typewarnr   r   r   r   r8   
typing.Anyr9   type[typing.Any] | Noner:   kwargsr   r+   c                    |j         d	dd| di|}|| d|d}|| d|j         d}|rt          j        |t          d           dS | j        r+| j                            t          ||                     dS t          ||          )
z9Raise a configuration error, or add it to the error list.r   "Nz (got r/   r%   )
stacklevelr   r   )	formatr   warningsr:   r   r5   r7   appendr   )r   r   r   r8   r9   r:   r=   s          r   config_errorzErrorCollector.config_errorQ   s     cj22ZZZZ2622?(((((C44 1444C 	3M#3BBBBBB  	3K1#3???@@@@@$Sc2222r   c                >    | j         rt          || j                   dS )z0Raise a group exception if there are any errors.N)r7   r   )r   r   s     r   finalizezErrorCollector.finalizei   s(    ; 	3 dk222	3 	3r   "typing.Generator[None, None, None]c              #     K   | j         r>	 dV  dS # t          $ r*}| j                            |j                   Y d}~dS d}~ww xY wdV  dS )z:Support nesting; add any grouped errors to the error list.N)r5   r   r7   extendr*   )r   errors     r   collectzErrorCollector.collectn   s~        	5! 5 5 5""5#34444444445 EEEEEs    
AA  A)r   r   r   r   r8   r;   r9   r<   r:   r4   r=   r;   r   r+   )r   r   r   r+   )r   rG   )r   r   r    r!   r1   dataclassesfieldlistr7   rD   rF   
contextlibcontextmanagerrK   r   r   r   r3   r3   G   s          
 /k/EEEFEEEE ,03 3 3 3 3 303 3 3 3
      r   r3   )r   r   )r!   
__future__r   builtinsrO   rL   systypingrB   r   r   	Exceptionr   UserWarningr   version_infor   	dataclassr3   r   r   r   <module>rY      sf    # " " " " "          



       
 
 
 
 
 
 
 
+ + + + +; + + + w,NNW W W W W W W W( / / / / / / / / / /r   