@@ -87,8 +87,9 @@ class _GeneratorContextManagerBase(Generic[_G_co]):
8787
8888class _GeneratorContextManager (
8989 _GeneratorContextManagerBase [Generator [_T_co , _SendT_contra , _ReturnT_co ]],
90- AbstractContextManager [_T_co , _ExitT_co ],
90+ AbstractContextManager [_T_co , bool | None ],
9191 ContextDecorator [_ExcReturnT ], # _ExcReturnT is inferred by the type checker
92+ Generic [_T_co , _SendT_contra , _ReturnT_co , _ExcReturnT , _ExitT_co ],
9293):
9394 def __exit__ (
9495 self , typ : type [BaseException ] | None , value : BaseException | None , traceback : TracebackType | None
@@ -104,8 +105,9 @@ if sys.version_info >= (3, 10):
104105
105106 class _AsyncGeneratorContextManager (
106107 _GeneratorContextManagerBase [AsyncGenerator [_T_co , _SendT_contra ]],
107- AbstractAsyncContextManager [_T_co , _ExitT_co ],
108+ AbstractAsyncContextManager [_T_co , bool | None ],
108109 AsyncContextDecorator [_ExcReturnT ], # _ExcReturnT is inferred by the type checker
110+ Generic [_T_co , _SendT_contra , _ReturnT_co , _ExcReturnT , _ExitT_co ],
109111 ):
110112 async def __aexit__ (
111113 self , typ : type [BaseException ] | None , value : BaseException | None , traceback : TracebackType | None
0 commit comments