import sys
import os
_repo_root = os.path.normpath(os.path.join(os.path.dirname(__file__), "..", "..", "..", ".."))
_candidates = [
os.environ.get("LIB_CLUSTERSHELL"),
os.path.join(os.path.dirname(_repo_root), "consortium-tests", "lib"),
os.path.join(_repo_root, "lib"),
]
for _cand in _candidates:
if _cand and os.path.isdir(_cand):
_lib_dir = os.path.normpath(_cand)
if _lib_dir not in sys.path:
sys.path.insert(0, _lib_dir)
break
import importlib as _importlib
def __getattr__(name):
try:
mod = _importlib.import_module(f"ClusterShell.{name}", package=None)
return mod
except ImportError:
raise AttributeError(f"module 'ClusterShell._py' has no attribute {name!r}")