a ‚oeÚã@sjdZddlmZmZmZmZer2ddlmZmZneZZeee dœdd„Z eeee fdœd d „Z d S) z) Compatibility layer with Python 3.8/3.9 é)Ú TYPE_CHECKINGÚAnyÚOptionalÚTupleé)Ú DistributionÚ EntryPoint)ÚdistÚreturnc CsHz|jWStyBddlm}| t|ddƒp:|jd¡YS0dS)z] Honor name normalization for distributions that don't provide ``_normalized_name``. r)ÚPreparedÚnameNÚName)Z_normalized_nameÚAttributeErrorÚr Ú normalizeÚgetattrÚmetadata)r r ©rú?C:\Program Files\Certbot\pkgs\importlib_metadata\_py39compat.pyÚnormalized_name s   r)Úepr cKs`z||jfi|¤ŽfWStyZddlm}||j|j|jƒ}||jfi|¤ŽfYS0dS)aª Workaround for ``EntryPoint`` objects without the ``matches`` method. For the sake of convenience, a tuple is returned containing not only the boolean value corresponding to the predicate evalutation, but also a compatible ``EntryPoint`` object that can be safely used at a later stage. For example, the following sequences of expressions should be compatible: # Sequence 1: using the compatibility layer candidates = (_py39compat.ep_matches(ep, **params) for ep in entry_points) [ep for ep, predicate in candidates if predicate] # Sequence 2: using Python 3.9+ [ep for ep in entry_points if ep.matches(**params)] r)rN)Úmatchesrrrr ÚvalueÚgroup)rÚparamsrZ_eprrrÚ ep_matchess   rN) Ú__doc__ÚtypingrrrrrrrÚstrrÚboolrrrrrÚs