B
    ÓùÓ`,	  ã               @   sv   d dl Z ddddgZyd dlmZ W n  ek
rD   d dlmZ Y nX dd„ Zdd	„ ZG d
d„ dƒZG dd„ dƒZ	dS )é    NÚinstallÚ
NullFinderÚ	PyPy_reprÚProtocol)r   c             C   s   t j | ƒ ¡ tƒ  | S )zÒ
    Class decorator for installation on sys.meta_path.

    Adds the backport DistributionFinder to sys.meta_path and
    attempts to disable the finder functionality of the stdlib
    DistributionFinder.
    )ÚsysÚ	meta_pathÚappendÚdisable_stdlib_finder)Úcls© r   ú>/tmp/pip-unpacked-wheel-iulr3fb9/importlib_metadata/_compat.pyr      s    c              C   s&   dd„ } xt | tjƒD ]}|`qW dS )zÀ
    Give the backport primacy for discovering path-based distributions
    by monkey-patching the stdlib O_O.

    See #91 for more background for rationale on this sketchy
    behavior.
    c             S   s   t | dd ƒdkot| dƒS )NÚ
__module__Ú_frozen_importlib_externalÚfind_distributions)ÚgetattrÚhasattr)Úfinderr   r   r   Úmatches(   s    z&disable_stdlib_finder.<locals>.matchesN)Úfilterr   r   r   )r   r   r   r   r   r	      s    	r	   c               @   s    e Zd ZdZedd„ ƒZeZdS )r   zj
    A "Finder" (aka "MetaClassFinder") that never finds any modules,
    but may find distributions.
    c              O   s   d S )Nr   )ÚargsÚkwargsr   r   r   Ú	find_spec7   s    zNullFinder.find_specN)Ú__name__r   Ú__qualname__Ú__doc__Ústaticmethodr   Úfind_moduler   r   r   r   r   1   s   
c               @   s,   e Zd ZdZeedƒZdd„ Zer&eZ[dS )r   zc
    Override repr for EntryPoint objects on PyPy to avoid __iter__ access.
    Ref #97, #102.
    Úpypy_version_infoc                s*   ‡ fdd„}d  t|ˆ jƒ¡}d|› d�S )Nc                s   t ˆ | ƒ}| › d|›�S )Nú=)r   )ÚnameÚvalue)Úselfr   r   Ú
make_paramM   s    
z-PyPy_repr.__compat_repr__.<locals>.make_paramz, zEntryPoint(ú))ÚjoinÚmapÚ_fields)r!   r"   Úparamsr   )r!   r   Ú__compat_repr__L   s    zPyPy_repr.__compat_repr__N)	r   r   r   r   r   r   Zaffectedr(   Ú__repr__r   r   r   r   r   D   s   
)
r   Ú__all__Útypingr   ÚImportErrorZtyping_extensionsr   r	   r   r   r   r   r   r   Ú<module>   s   