tessl install tessl/pypi-tox-pyenv@1.1.0tox plugin that makes tox use `pyenv which` to find python executables
Agent Success
Agent success rate when using this tile
98%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.03x
Baseline
Agent success rate without this tile
95%
Build a simple process execution wrapper that uses a custom exception hierarchy to handle different types of process execution failures.
Your task is to implement a process runner module that executes system commands and handles errors using a well-structured exception hierarchy.
Design and implement a custom exception hierarchy with:
The hierarchy should follow Python exception best practices where more specific exceptions inherit from more general ones.
Implement a function that executes system commands with the following behavior:
@generates
class ProcessException(Exception):
"""Base exception for process execution errors."""
pass
class ExecutableNotFound(ProcessException):
"""Raised when the requested executable cannot be found."""
pass
class ExecutionFailed(ProcessException):
"""Raised when the executable runs but exits with non-zero status."""
pass
def run_command(executable, *args):
"""
Execute a system command and return its output.
Args:
executable: The command/executable name to run
*args: Optional arguments to pass to the command
Returns:
str: The stdout output from the command (stripped)
Raises:
ExecutableNotFound: If the executable cannot be found
ExecutionFailed: If the executable exits with non-zero status
"""
passThis implementation should use only Python standard library modules.