a
    b3jx
                     @  s   d dl mZ d dlZd dlZd dlZd dlZdgZddddZejdkrXd d	l	m
Z
 nG d
d deZ
ejG dd dZdS )    )annotationsNExceptionGroupz	list[str]returnc                   C  s   t S N)__all__ r   r   m/www/wwwroot/dpstar/app/297b3aabda72fedb274352021c2dd8b5_venv/lib/python3.9/site-packages/packaging/errors.py__dir__   s    r
   )      )r   c                   @  sB   e Zd ZU dZded< ded< dddddd	Zdd
ddZdS )r   zA minimal implementation of :external:exc:`ExceptionGroup` from Python 3.11.

        If :external:exc:`ExceptionGroup` is already defined by Python itself,
        that version is used instead.
        strmessagelist[Exception]
exceptionsNone)r   r   r   c                 C  s   || _ || _d S r   )r   r   )selfr   r   r   r   r	   __init__   s    zExceptionGroup.__init__r   c                 C  s   | j j d| jd| jdS )N(z, ))	__class____name__r   r   )r   r   r   r	   __repr__!   s    zExceptionGroup.__repr__N)r   
__module____qualname____doc____annotations__r   r   r   r   r   r	   r      s
   
c                   @  st   e Zd ZU dZejeddZded< dddd	d
Z	e
jdddddZe
jdddddZdddddZdS )_ErrorCollectora  
    Collect errors into ExceptionGroups.

    Used like this:

        collector = _ErrorCollector()
        # Add a single exception
        collector.error(ValueError("one"))

        # Supports nesting, including combining ExceptionGroups
        with collector.collect():
            raise ValueError("two")
        collector.finalize("Found some errors")

    Since making a collector and then calling finalize later is a common pattern,
    a convenience method ``on_exit`` is provided.
    F)default_factoryinitr   errorsr   r   )msgr   c                 C  s   | j rt|| j dS )z0Raise a group exception if there are any errors.N)r    r   r   r!   r   r   r	   finalize;   s    z_ErrorCollector.finalizez-typing.Generator[_ErrorCollector, None, None]c                 c  s   | V  |  | dS )zx
        Calls finalize if no uncollected errors were present.

        Uncollected errors are raised normally.
        N)r#   r"   r   r   r	   on_exit@   s    z_ErrorCollector.on_exitztype[Exception]z"typing.Generator[None, None, None])err_clsr   c              
   g  sz   |pt f}z
dV  W n` tyF } z| j|j W Y d}~n8d}~0  |yt } z| j| W Y d}~n
d}~0 0 dS )z
        Context manager to collect errors into the error list.

        Must be inside loops, as only one error can be collected at a time.
        N)	Exceptionr   r    extendr   append)r   r%   Zerror_classeserrorr   r   r	   collectJ   s    

"z_ErrorCollector.collectr&   )r)   r   c                 C  s   | j | dS )zAdd an error to the list.N)r    r(   )r   r)   r   r   r	   r)   Y   s    z_ErrorCollector.errorN)r   r   r   r   dataclassesfieldlistr    r   r#   
contextlibcontextmanagerr$   r*   r)   r   r   r   r	   r   %   s   
	r   )
__future__r   r.   r+   systypingr   r
   version_infobuiltinsr   r&   Z	dataclassr   r   r   r   r	   <module>   s   
