Skip to content

Commit 0eb0fe8

Browse files
authored
Merge pull request #2537 from gschaffner/missing-typing_extensions-crash
Fix crash due to runtime import of `typing_extensions`
2 parents 4286063 + 4bb011e commit 0eb0fe8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

trio/_core/_run.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323
from sniffio import current_async_library_cvar
2424
from sortedcontainers import SortedDict
2525

26-
# An unfortunate name collision here with trio._util.Final
27-
from typing_extensions import Final as FinalT
28-
2926
from .. import _core
3027
from .._util import Final, NoPublicConstructor, coroutine_or_error
3128
from ._asyncgens import AsyncGenerators
@@ -47,6 +44,10 @@
4744
if sys.version_info < (3, 11):
4845
from exceptiongroup import BaseExceptionGroup
4946

47+
if TYPE_CHECKING:
48+
# An unfortunate name collision here with trio._util.Final
49+
from typing_extensions import Final as FinalT
50+
5051
DEADLINE_HEAP_MIN_PRUNE_THRESHOLD: FinalT = 1000
5152

5253
_NO_SEND: FinalT = object()

0 commit comments

Comments
 (0)