INNER CODE UNIT · Python

_execute

browser-use/macos-harness · src/macos_harness/cli.py:31

def _execute(code: str) -> int:
    if not code.strip():
        print("No Python code received on stdin", file=sys.stderr)
        return 2
    namespace = _namespace()
    exec(compile(code, "<macos-harness>", "exec"), namespace, namespace)  # noqa: S102
    return 0


def _skill_text() -> str:
    bundled = resources.files("macos_harness").joinpath("SKILL.md")
    if bundled.is_file():
        return bundled.read_text(encoding="utf-8")
    checkout = Path(__file__).resolve().parents[2] / "skills/macos-harness/SKILL.md"
    return checkout.read_text(encoding="utf-8")


def _build_parser() -> argparse.ArgumentParser:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…