SILENT KILLERPanel

Current Path: > > opt > hc_python > lib64 > python3.12 > site-packages > > importlib_metadata > compat


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: //opt/hc_python/lib64/python3.12/site-packages//importlib_metadata/compat

NameTypeSizeLast ModifiedActions
__pycache__ Directory - -
__init__.py File 0 bytes May 23 2025 10:34:46.
py311.py File 608 bytes May 23 2025 10:34:46.
py39.py File 1187 bytes May 23 2025 10:34:46.

Reading File: //opt/hc_python/lib64/python3.12/site-packages//importlib_metadata/compat/py39.py

"""
Compatibility layer with Python 3.8/3.9
"""

from __future__ import annotations

from typing import TYPE_CHECKING, Any

if TYPE_CHECKING:  # pragma: no cover
    # Prevent circular imports on runtime.
    from .. import Distribution, EntryPoint
else:
    Distribution = EntryPoint = Any

from .._typing import md_none


def normalized_name(dist: Distribution) -> str | None:
    """
    Honor name normalization for distributions that don't provide ``_normalized_name``.
    """
    try:
        return dist._normalized_name
    except AttributeError:
        from .. import Prepared  # -> delay to prevent circular imports.

        return Prepared.normalize(
            getattr(dist, "name", None) or md_none(dist.metadata)['Name']
        )


def ep_matches(ep: EntryPoint, **params) -> bool:
    """
    Workaround for ``EntryPoint`` objects without the ``matches`` method.
    """
    try:
        return ep.matches(**params)
    except AttributeError:
        from .. import EntryPoint  # -> delay to prevent circular imports.

        # Reconstruct the EntryPoint object to make sure it is compatible.
        return EntryPoint(ep.name, ep.value, ep.group).matches(**params)

SILENT KILLER Tool