async-exit-stack
AsyncExitStack backport for Python 3.5+
Decision gist · record as of 2026-08-14
No, unless you are maintaining legacy code on Python 3.5 or 3.6. The package is abandoned and receives no updates. Modern Python versions (3.7+) include AsyncExitStack in the standard library; use that instead. If you must support older Python, this backport works but carries no active maintenance risk mitigation.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.5 or later; intended for older Python versions that lack native AsyncExitStack support.
- Installation is straightforward with no runtime dependencies.
- However, the package is abandoned—last updated in 2022 with no commits since December 2022—so it receives no active maintenance or security updates.
License · maintenance · safety
permissive license (permissive) — Licensed under the Python Software Foundation License (permissive), which allows free use, modification, and distribution with minimal restrictions.
last release 2018-05-07 (3021 days) · last repo commit 2022-12-26 · 8 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 88,016 downloads/mo, #13,754 on PyPI
Alternatives
Verify before relying
pip install async-exit-stack
from async_exit_stack import AsyncExitStack
async def example():
async with AsyncExitStack() as stack:
resource = await stack.enter_async_context(get_connection())
# Resource automatically cleaned up on exit- Whether AsyncExitStack is still needed: Python 3.7+ includes it in the standard library contextlib module.
- Compatibility with Python versions beyond 3.6: classifiers list only 3.5 and 3.6, but requires_python states >=3.5.
What it is and what it does
AsyncExitStack is a backport of Python 3.7's asynchronous context manager from the standard library, extracted into a standalone package for use on Python 3.5 and 3.6. It allows you to combine multiple async context managers and register async cleanup callbacks within a single async with block, ensuring resources are properly released even if exceptions occur during setup.
The package is essentially a copy of CPython's implementation and provides the same API as the standard library version: enter_async_context() to register async context managers, push_async_callback() to register coroutine cleanup handlers, and aclose() to trigger cleanup. It is most useful as a compatibility shim for older Python versions; modern projects targeting Python 3.7+ should use the built-in contextlib.AsyncExitStack instead.
Use it for
- Managing multiple database or network connections in async code on Python 3.5–3.6 with automatic cleanup.
- Registering async cleanup handlers (e.g., closing resources) that must run even if earlier setup steps fail.
- Combining both sync and async context managers in a single async with block on older Python versions.
- Porting async code from Python 3.7+ back to Python 3.5–3.6 without rewriting resource management logic.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
No, unless you are maintaining legacy code on Python 3.5 or 3.6.
The package is abandoned and receives no updates. Modern Python versions (3.7+) include AsyncExitStack in the standard library; use that instead. If you must support older Python, this backport works but carries no active maintenance risk mitigation.
Install
async-exit-stack on PyPI
Before you install
Installation is straightforward with no runtime dependencies. However, the package is abandoned—last updated in 2022 with no commits since December 2022—so it receives no active maintenance or security updates.
Requires Python 3.5 or later; intended for older Python versions that lack native AsyncExitStack support.
License in practice
Licensed under the Python Software Foundation License (permissive), which allows free use, modification, and distribution with minimal restrictions.
Quickstart
pip install async-exit-stack
from async_exit_stack import AsyncExitStack
async def example():
async with AsyncExitStack() as stack:
resource = await stack.enter_async_context(get_connection())
# Resource automatically cleaned up on exit
Verify before relying
- Whether AsyncExitStack is still needed: Python 3.7+ includes it in the standard library contextlib module.
- Compatibility with Python versions beyond 3.6: classifiers list only 3.5 and 3.6, but requires_python states >=3.5.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.5 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Abandoned 3,021 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 88,016 / month, #13,754 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Python Software Foundation LicenseNatural Language :: EnglishProgramming Language :: Python :: 3Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6 |
Evidence: async_exit_stack-1.0.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “async context manager cleanup”
- async-exit-stackProvides AsyncExitStack, a backport of Python 3.7's asynchronous…
- uncalled-forProvides async dependency injection for Python functions using…
- aiotoolsaiotools provides idiomatic asyncio utilities for structured…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also async_generator · asyncio-atexit · backports.weakref · asyncio · contextlib2 · aiotools · uncalled-for · pyleak · backports.asyncio.runner · contextvars