@@ -87,8 +87,9 @@ class _GeneratorContextManagerBase(Generic[_G_co]):
87
87
88
88
class _GeneratorContextManager (
89
89
_GeneratorContextManagerBase [Generator [_T_co , _SendT_contra , _ReturnT_co ]],
90
- AbstractContextManager [_T_co , _ExitT_co ],
90
+ AbstractContextManager [_T_co , bool | None ],
91
91
ContextDecorator [_ExcReturnT ], # _ExcReturnT is inferred by the type checker
92
+ Generic [_T_co , _SendT_contra , _ReturnT_co , _ExcReturnT , _ExitT_co ],
92
93
):
93
94
def __exit__ (
94
95
self , typ : type [BaseException ] | None , value : BaseException | None , traceback : TracebackType | None
@@ -104,8 +105,9 @@ if sys.version_info >= (3, 10):
104
105
105
106
class _AsyncGeneratorContextManager (
106
107
_GeneratorContextManagerBase [AsyncGenerator [_T_co , _SendT_contra ]],
107
- AbstractAsyncContextManager [_T_co , _ExitT_co ],
108
+ AbstractAsyncContextManager [_T_co , bool | None ],
108
109
AsyncContextDecorator [_ExcReturnT ], # _ExcReturnT is inferred by the type checker
110
+ Generic [_T_co , _SendT_contra , _ReturnT_co , _ExcReturnT , _ExitT_co ],
109
111
):
110
112
async def __aexit__ (
111
113
self , typ : type [BaseException ] | None , value : BaseException | None , traceback : TracebackType | None
0 commit comments