From 0da00689b7e0841fdb5de7f139c2cabeee43987e Mon Sep 17 00:00:00 2001 From: Ganden Schaffner Date: Mon, 19 Dec 2022 00:00:00 -0800 Subject: [PATCH] Fix crash due to runtime import of typing_extensions typing_extensions doesn't presently need to be a runtime dependency. --- trio/_unix_pipes.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/trio/_unix_pipes.py b/trio/_unix_pipes.py index 50c6ad2aac..fa98e79521 100644 --- a/trio/_unix_pipes.py +++ b/trio/_unix_pipes.py @@ -2,13 +2,16 @@ import os import errno -from typing_extensions import Final as FinalType +from typing import TYPE_CHECKING from ._abc import Stream from ._util import ConflictDetector, Final import trio +if TYPE_CHECKING: + from typing_extensions import Final as FinalType + if os.name != "posix": # We raise an error here rather than gating the import in lowlevel.py # in order to keep jedi static analysis happy.