Skip to content

Commit 91a1350

Browse files
authored
Merge pull request #2507 from gschaffner/missing-typing_extensions-crash
Fix crash due to runtime import of `typing_extensions`
2 parents ec32bb8 + 0da0068 commit 91a1350

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

trio/_unix_pipes.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22

33
import os
44
import errno
5-
from typing_extensions import Final as FinalType
5+
from typing import TYPE_CHECKING
66

77
from ._abc import Stream
88
from ._util import ConflictDetector, Final
99

1010
import trio
1111

12+
if TYPE_CHECKING:
13+
from typing_extensions import Final as FinalType
14+
1215
if os.name != "posix":
1316
# We raise an error here rather than gating the import in lowlevel.py
1417
# in order to keep jedi static analysis happy.

0 commit comments

Comments
 (0)