From 395ce4987752efb59391afe6491666f847a11d21 Mon Sep 17 00:00:00 2001 From: Raf Blecher Date: Fri, 21 Jun 2019 21:38:42 -0700 Subject: [PATCH] fix contextlib GeneratorContextManager name for py>=3.2 --- stdlib/2and3/contextlib.pyi | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stdlib/2and3/contextlib.pyi b/stdlib/2and3/contextlib.pyi index dec1b411d515..7d092096bc0a 100644 --- a/stdlib/2and3/contextlib.pyi +++ b/stdlib/2and3/contextlib.pyi @@ -25,10 +25,12 @@ _ExitFunc = Callable[[Optional[Type[BaseException]], _CM_EF = TypeVar('_CM_EF', ContextManager, _ExitFunc) if sys.version_info >= (3, 2): - class GeneratorContextManager(ContextManager[_T], Generic[_T]): + class _GeneratorContextManager(ContextManager[_T], Generic[_T]): def __call__(self, func: Callable[..., _T]) -> Callable[..., _T]: ... - def contextmanager(func: Callable[..., Iterator[_T]]) -> Callable[..., GeneratorContextManager[_T]]: ... + def contextmanager(func: Callable[..., Iterator[_T]]) -> Callable[..., _GeneratorContextManager[_T]]: ... else: + class GeneratorContextManager(ContextManager[_T], Generic[_T]): + def __call__(self, func: Callable[..., _T]) -> Callable[..., _T]: ... def contextmanager(func: Callable[..., Iterator[_T]]) -> Callable[..., ContextManager[_T]]: ... if sys.version_info >= (3, 7):