Skip to content

Commit 737d851

Browse files
committed
make ExitStack/AsyncExitStack not appear as abstract
1 parent b0401bc commit 737d851

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

stdlib/contextlib.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,15 @@ class _RedirectStream(AbstractContextManager[_SupportsRedirectT, None]):
172172
class redirect_stdout(_RedirectStream[_SupportsRedirectT]): ...
173173
class redirect_stderr(_RedirectStream[_SupportsRedirectT]): ...
174174

175-
class _BaseExitStack(Generic[_ExitT_co]):
175+
class _BaseExitStack(Generic[_ExitT_co], metaclass=abc.ABCMeta):
176176
def enter_context(self, cm: AbstractContextManager[_T, _ExitT_co]) -> _T: ...
177177
def push(self, exit: _CM_EF) -> _CM_EF: ...
178178
def callback(self, callback: Callable[_P, _T], /, *args: _P.args, **kwds: _P.kwargs) -> Callable[_P, _T]: ...
179179
def pop_all(self) -> Self: ...
180180

181181
# In reality this is a subclass of `AbstractContextManager`;
182182
# see #7961 for why we don't do that in the stub
183-
class ExitStack(_BaseExitStack[_ExitT_co], metaclass=abc.ABCMeta):
183+
class ExitStack(_BaseExitStack[_ExitT_co]):
184184
def close(self) -> None: ...
185185
def __enter__(self) -> Self: ...
186186
def __exit__(
@@ -194,7 +194,7 @@ _ACM_EF = TypeVar("_ACM_EF", bound=AbstractAsyncContextManager[Any, Any] | _Exit
194194

195195
# In reality this is a subclass of `AbstractAsyncContextManager`;
196196
# see #7961 for why we don't do that in the stub
197-
class AsyncExitStack(_BaseExitStack[_ExitT_co], metaclass=abc.ABCMeta):
197+
class AsyncExitStack(_BaseExitStack[_ExitT_co]):
198198
async def enter_async_context(self, cm: AbstractAsyncContextManager[_T, _ExitT_co]) -> _T: ...
199199
def push_async_exit(self, exit: _ACM_EF) -> _ACM_EF: ...
200200
def push_async_callback(

0 commit comments

Comments
 (0)