File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55
66import inspect
77from contextlib import ExitStack , contextmanager
8- from typing import Iterator , cast
8+ from typing import TYPE_CHECKING , cast
99
1010import click
1111from markdown .extensions .toc import slugify
1212
1313from ._exceptions import MkDocsClickException
1414
15+ if TYPE_CHECKING :
16+ from collections .abc import Iterator
17+
1518
1619def make_command_docs (
1720 prog_name : str ,
Original file line number Diff line number Diff line change 33# Licensed under the Apache license (see LICENSE)
44from __future__ import annotations
55
6- from typing import Any , Iterator
6+ from typing import TYPE_CHECKING , Any
77
88from markdown .extensions import Extension
99from markdown .extensions .attr_list import AttrListExtension
1414from ._loader import load_command
1515from ._processing import replace_blocks
1616
17+ if TYPE_CHECKING :
18+ from collections .abc import Iterator
19+
1720
1821def replace_command_docs (has_attr_list : bool = False , ** options : Any ) -> Iterator [str ]:
1922 for option in ("module" , "command" ):
Original file line number Diff line number Diff line change 44from __future__ import annotations
55
66import re
7- from typing import Callable , Iterable , Iterator
7+ from typing import TYPE_CHECKING , Callable
8+
9+ if TYPE_CHECKING :
10+ from collections .abc import Iterable , Iterator
811
912
1013def replace_blocks (
You can’t perform that action at this time.
0 commit comments