|
4 | 4 | import sys
|
5 | 5 | from os.path import dirname, relpath
|
6 | 6 | from pathlib import Path
|
7 |
| -from typing import Dict, List |
| 7 | +from typing import Dict, List, Union |
8 | 8 |
|
9 | 9 | import libtmux # NOQA
|
10 | 10 | from libtmux import test # NOQA
|
|
17 | 17 | sys.path.insert(0, str(cwd / "_ext"))
|
18 | 18 |
|
19 | 19 | # package data
|
20 |
| -about: Dict = {} |
| 20 | +about: Dict[str, str] = {} |
21 | 21 | with open("../libtmux/__about__.py") as fp:
|
22 | 22 | exec(fp.read(), about)
|
23 | 23 |
|
|
69 | 69 | html_css_files = ["css/custom.css"]
|
70 | 70 | html_extra_path = ["manifest.json"]
|
71 | 71 | html_theme = "furo"
|
72 |
| -html_theme_path: List = [] |
73 |
| -html_theme_options: Dict = { |
| 72 | +html_theme_path: List[str] = [] |
| 73 | +html_theme_options: Dict[str, Union[str, List[Dict[str, str]]]] = { |
74 | 74 | "light_logo": "img/libtmux.svg",
|
75 | 75 | "dark_logo": "img/libtmux.svg",
|
76 | 76 | "footer_icons": [
|
|
162 | 162 | intersphinx_mapping = {"http://docs.python.org/": None}
|
163 | 163 |
|
164 | 164 |
|
165 |
| -def linkcode_resolve(domain, info): # NOQA: C901 |
| 165 | +def linkcode_resolve( |
| 166 | + domain: str, info: Dict[str, str] |
| 167 | +) -> Union[None, str]: # NOQA: C901 |
166 | 168 | """
|
167 | 169 | Determine the URL corresponding to Python object
|
168 | 170 |
|
@@ -195,7 +197,8 @@ def linkcode_resolve(domain, info): # NOQA: C901
|
195 | 197 | except AttributeError:
|
196 | 198 | pass
|
197 | 199 | else:
|
198 |
| - obj = unwrap(obj) |
| 200 | + if callable(obj): |
| 201 | + obj = unwrap(obj) |
199 | 202 |
|
200 | 203 | try:
|
201 | 204 | fn = inspect.getsourcefile(obj)
|
|
0 commit comments