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