A signal-based timeout context manager for Python. Current version 2.0.0. Uses OS signals to interrupt long-running operations. Updated to require Python >=3.10. Release cadence is low (major versions separated by years).
pip install timeoutcontextNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic usage: wrap long-running operations in a `with timeout(seconds)` block. Raises TimeoutError if time exceeded.
Use `except TimeoutError` instead of `except Timeout`. Update Python requirement to >=3.10.
Use on Unix/Linux/macOS for correct behavior. On Windows, consider alternative libraries like `stopit` or `threading.Timer`.
timeoutcontext will silently not timeout on Windows. Use on Unix or handle unsupported OS explicitly.
Import TimeoutError from timeoutcontext: `from timeoutcontext import TimeoutError` or catch the built-in `TimeoutError` directly (Python 3.11+).
No dependency data recorded yet.