Skip to content

Commit 4f91db8

Browse files
committed
fix: use correct importing for typing_extensions
1 parent 0772c78 commit 4f91db8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/mistune/core.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import re
2+
import sys
23
from typing import (
34
Any,
45
Callable,
@@ -16,9 +17,9 @@
1617
Union,
1718
cast,
1819
)
19-
try:
20+
if sys.version_info >= (3, 11):
2021
from typing import Self
21-
except ImportError:
22+
else:
2223
from typing_extensions import Self
2324

2425
_LINE_END = re.compile(r'\n|$')

0 commit comments

Comments
 (0)