We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef87743 commit cc1214eCopy full SHA for cc1214e
markdown_it/renderer.py
@@ -6,7 +6,6 @@ class Renderer
6
rules if you create plugin and adds new token types.
7
"""
8
import inspect
9
-import sys
10
from typing import (
11
ClassVar,
12
MutableMapping,
@@ -18,10 +17,10 @@ class Renderer
18
17
from .token import Token
19
from .utils import OptionsDict
20
21
-if sys.version_info < (3, 8):
22
- from typing_extensions import Protocol
23
-else:
+try:
24
from typing import Protocol
+except ImportError: # Python <3.8 doesn't have `Protocol` in the stdlib
+ from typing_extensions import Protocol # type: ignore[misc]
25
26
27
class RendererProtocol(Protocol):
0 commit comments