A backport of AsyncExitStack from Python 3.7+ for use on Python 3.5 and 3.6. It provides an async context manager that can combine multiple async context managers and cleanup callbacks. Current version 1.0.1, release cadence is low (last release in 2018).
pip install async-exit-stackVerified import paths — ran on the pinned version, not inferred.
Minimal example using AsyncExitStack to enter an async context manager and push a callback.
Upgrade to Python 3.7+ and use `from contextlib import AsyncExitStack`. Remove dependency on async-exit-stack.
Import as `from async_exit_stack import AsyncExitStack`.
Use `await stack.enter_async_context(cm)` instead of `stack.enter_context(cm)`.
Run `pip install async-exit-stack` and then use `from async_exit_stack import AsyncExitStack`.
Ensure you have the correct package installed and no local file named async_exit_stack.py. Uninstall and reinstall: `pip uninstall async-exit-stack` and `pip install async-exit-stack`.
Use `async with AsyncExitStack() as stack:` not `await AsyncExitStack()`.
No dependency data recorded yet.