@@ -87,12 +87,12 @@ class _GeneratorContextManagerBase(Generic[_G_co]):
8787
8888class _GeneratorContextManager (
8989 _GeneratorContextManagerBase [Generator [_T_co , _SendT_contra , _ReturnT_co ]],
90- AbstractContextManager [_T_co , bool | None ],
90+ AbstractContextManager [_T_co , _ExitT_co ],
9191 ContextDecorator [_ExcReturnT ], # _ExcReturnT is inferred by the type checker
9292):
9393 def __exit__ (
9494 self , typ : type [BaseException ] | None , value : BaseException | None , traceback : TracebackType | None
95- ) -> bool | None : ...
95+ ) -> _ExitT_co : ...
9696
9797def contextmanager (func : Callable [_P , Iterator [_T_co ]]) -> Callable [_P , _GeneratorContextManager [_T_co ]]: ...
9898
@@ -104,12 +104,12 @@ if sys.version_info >= (3, 10):
104104
105105 class _AsyncGeneratorContextManager (
106106 _GeneratorContextManagerBase [AsyncGenerator [_T_co , _SendT_contra ]],
107- AbstractAsyncContextManager [_T_co , bool | None ],
107+ AbstractAsyncContextManager [_T_co , _ExitT_co ],
108108 AsyncContextDecorator [_ExcReturnT ], # _ExcReturnT is inferred by the type checker
109109 ):
110110 async def __aexit__ (
111111 self , typ : type [BaseException ] | None , value : BaseException | None , traceback : TracebackType | None
112- ) -> bool | None : ...
112+ ) -> _ExitT_co : ...
113113
114114else :
115115 class _AsyncGeneratorContextManager (
0 commit comments