U
    \Sh                     @   s&   d dl Z d dlmZ edddZdS )    N)partial)
group_namec                 c   s   t jdkr`zddlm} W n tk
r.   Y n2X || d}t|ts`|D ]}|j|jfV  qHdS zddl	m
} W n tk
r   Y n(X || D ]}|jt|jddfV  qdS )	z
    Find entrypoints of a given group using either `importlib.metadata` or the
    older `pkg_resources` mechanism.

    Yields tuples of the entrypoint name and a callable function that will
    load the actual entrypoint.
    )   
   r   )entry_points)groupN)working_setT)require)sysversion_infoimportlib.metadatar   ImportError
isinstancedictnameloadpkg_resourcesr   iter_entry_pointsr   )r   r   epsentry_pointr    r   I/root/rtd-docs/venv/lib/python3.8/site-packages/babel/messages/_compat.pyfind_entrypoints   s     


r   )r
   	functoolsr   strr   r   r   r   r   <module>   s   