import os import sys import warnings from contextlib import redirect_stderr def run(): print("job_id=job-20260329-104500") warnings.warn("optional profile 'batch-default' not found; using built-in defaults", UserWarning) print("worker stderr: retry budget exhausted", file=sys.stderr) raise RuntimeError("job processing failed") with open(os.devnull, "w") as null, redirect_stderr(null), warnings.catch_warnings(): warnings.simplefilter("ignore") try: run() except Exception: sys.exit(1)