
    "g!                     B    d dl Z d dlZddgZd Zd Z G d d      Zd Zy)    Ninstall
NullFinderc                 b    t         j                  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)clss    O/var/www/openai/venv/lib/python3.12/site-packages/importlib_metadata/_compat.pyr   r      s#     MMJ    c                  L    d } t        | t        j                        D ]  }|` y)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                 >    t        | dd       dk(  xr t        | d      S )N
__module___frozen_importlib_externalfind_distributions)getattrhasattr)finders    r   matchesz&disable_stdlib_finder.<locals>.matches   s0    L$
)* T.5f>R.S	Tr   N)filterr   r   r   )r   r   s     r   r	   r	      s%    T
 #--0% 1r   c                        e Zd ZdZed        Zy)r   zi
    A "Finder" (aka "MetaPathFinder") that never finds any modules,
    but may find distributions.
    c                       y )N )argskwargss     r   	find_speczNullFinder.find_spec,   s    r   N)__name__r   __qualname____doc__staticmethodr   r   r   r   r   r   &   s    
  r   c                 :    t        j                         dk(  }| |z   S )zY
    Adjust for variable stacklevel on partial under PyPy.

    Workaround for #327.
    PyPy)platformpython_implementation)valis_pypys     r   pypy_partialr'   1   s!     ,,.&8G=r   )r#   r   __all__r   r	   r   r'   r   r   r   <module>r)      s.     
l
#
&$ r   