From 143cf3d6d338d14728386f8c0b31d4d2f00d1317 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Sun, 15 Dec 2024 14:16:46 +0000 Subject: [PATCH] make _Interceptor not abstract --- taskgroup/tasks.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/taskgroup/tasks.py b/taskgroup/tasks.py index f409a94..88d5d10 100644 --- a/taskgroup/tasks.py +++ b/taskgroup/tasks.py @@ -4,7 +4,7 @@ import collections.abc import contextvars from typing import Any, Optional, Union -from typing_extensions import TypeAlias, TypeVar +from typing_extensions import TypeAlias, TypeVar, Self import sys _YieldT_co = TypeVar("_YieldT_co", covariant=True) @@ -50,6 +50,9 @@ def throw(self, *exc_info) -> _YieldT_co: def __getattr__(self, name): return getattr(self.__coro, name) + def __await__(self) -> Self: + return self + def close(self) -> None: super().close()