U
    ?h!                     @   sB   d dl Z d dlZddgZdd Zdd ZG dd dZdd	 ZdS )
    N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	   L/var/www/html/venv/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   zi
    A "Finder" (aka "MetaPathFinder") that never finds any modules,
    but may find distributions.
    c                  O   s   d S )Nr	   )argskwargsr	   r	   r
   	find_spec,   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)valZis_pypyr	   r	   r
   pypy_partial1   s    r   )r   r   __all__r   r   r   r   r	   r	   r	   r
   <module>   s   