Skip to content

Commit 0772c78

Browse files
committed
fix: importing Self from typing_extensions
1 parent f7db503 commit 0772c78

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dependencies = [
77
]
88
license = {text = "BSD-3-Clause"}
99
dynamic = ["version"]
10-
requires-python = ">=3.7"
10+
requires-python = ">=3.8"
1111
readme = "README.rst"
1212
classifiers = [
1313
"Development Status :: 4 - Beta",

src/mistune/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
Documentation: https://mistune.lepture.com/
99
"""
1010

11-
try:
12-
import typing_extensions
13-
except ImportError:
14-
pass
1511
from typing import Any, Dict, Iterable, List, Optional, Tuple, Union, Literal
1612
from .block_parser import BlockParser
1713
from .core import BaseRenderer, BlockState, InlineState

src/mistune/core.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@
1414
Type,
1515
TypeVar,
1616
Union,
17-
Self,
1817
cast,
1918
)
19+
try:
20+
from typing import Self
21+
except ImportError:
22+
from typing_extensions import Self
2023

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

0 commit comments

Comments
 (0)