| 80 | """ |
| 81 | |
| 82 | class PatchedPythonDomain(PythonDomain): |
| 83 | def resolve_xref( # noqa: PLR0913, PLR0917 |
| 84 | self, |
| 85 | env: BuildEnvironment, |
| 86 | fromdocname: str, |
| 87 | builder: Builder, |
| 88 | type: str, # noqa: A002 |
| 89 | target: str, |
| 90 | node: pending_xref, |
| 91 | contnode: Element, |
| 92 | ) -> reference | None: |
| 93 | mapping = { |
| 94 | "_thread._local": ("threading.local", "local"), |
| 95 | "asyncio.events.AbstractEventLoop": ("asyncio.AbstractEventLoop", "AbstractEventLoop"), |
| 96 | "concurrent.futures._base.Executor": ("concurrent.futures.Executor", "Executor"), |
| 97 | } |
| 98 | if target in mapping: |
| 99 | of_type, with_name = mapping[target] |
| 100 | target = of_type |
| 101 | node["reftarget"] = of_type |
| 102 | contnode.replace(contnode.children[0], Text(with_name)) |
| 103 | return super().resolve_xref(env, fromdocname, builder, type, target, node, contnode) |
| 104 | |
| 105 | app.add_domain(PatchedPythonDomain, override=True) |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…