import importlib.machinery
import importlib.util
import os
import sys
_HERE = os.path.dirname(os.path.abspath(__file__))
try:
if os.environ.get("SUPERCOV_PYTHON_PLAN"):
import supercov_runtime
supercov_runtime.install()
except Exception as error: sys.stderr.write(f"[supercov] start-up hook failed: {error!r}\n")
try:
_remaining = [
entry
for entry in sys.path
if os.path.abspath(entry or os.getcwd()) != _HERE
]
_spec = importlib.machinery.PathFinder.find_spec("sitecustomize", _remaining)
if _spec is not None and _spec.loader is not None:
_module = importlib.util.module_from_spec(_spec)
_spec.loader.exec_module(_module)
except Exception as error: sys.stderr.write(f"[supercov] chained sitecustomize failed: {error!r}\n")