U
    ¿9%e  ã                   @   s€   d dl Z d dlZd dlZd dlmZ ddgZdd„ Zdd„ ZG dd„ dƒZd	d
„ Z	ej
dkrpeee je f Zneedf ZdS )é    N)ÚUnionÚinstallÚ
NullFinderc                 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
   úY/var/www/html/Darija-Ai-API/env/lib/python3.8/site-packages/importlib_metadata/_compat.pyr      s    c                  C   s"   dd„ } t | tjƒD ]}|`q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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_spec0   s    zNullFinder.find_specN)Ú__name__r   Ú__qualname__Ú__doc__Ústaticmethodr   r
   r
   r
   r   r   *   s   c                 C   s   t  ¡ dk}| | S )zY
    Adjust for variable stacklevel on partial under PyPy.

    Workaround for #327.
    ÚPyPy)ÚplatformÚpython_implementation)ÚvalÚis_pypyr
   r
   r   Úpypy_partial5   s    r    )é   é	   zos.PathLike[str])Úosr   r   Útypingr   Ú__all__r   r   r   r    Úversion_infoÚstrÚPathLikeZStrPathr
   r
   r
   r   Ú<module>   s   

