Fix typing_extensions requirement inconsistency (#5700)

Typing Extensions is an optional requirement for `python>3.10`, thus
TypeVarTuple and Unpack need another import in higher python versions as
`typing_extensions` is not available

see https://docs.python.org/3.10/library/typing.html for supported types

close #5695
This commit is contained in:
Benedikt 2025-04-08 15:20:30 +02:00 committed by GitHub
commit 6895a946e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -36,9 +36,12 @@ from __future__ import annotations
import queue
import sys
from threading import Lock, Thread
from typing import Callable, Generator
from typing import Callable, Generator, TypeVar
from typing_extensions import TypeVar, TypeVarTuple, Unpack
if sys.version_info >= (3, 11):
from typing import TypeVarTuple, Unpack
else:
from typing_extensions import TypeVarTuple, Unpack
BUBBLE = "__PIPELINE_BUBBLE__"
POISON = "__PIPELINE_POISON__"