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