MCPcopy Index your code
hub / github.com/python/cpython / run

Method run

Doc/tools/extensions/issue_role.py:19–35  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

17 ISSUE_URI = "https://bugs.python.org/issue?@action=redirect&bpo={0}"
18
19 def run(self) -> tuple[list[Element], list[nodes.system_message]]:
20 issue = self.text
21
22 # sanity check: there are no bpo issues within these two values
23 if 47_261 < int(issue) < 400_000:
24 msg = self.inliner.reporter.error(
25 f"The BPO ID {issue!r} seems too high. "
26 "Use :gh:`...` for GitHub IDs.",
27 line=self.lineno,
28 )
29 prb = self.inliner.problematic(self.rawtext, self.rawtext, msg)
30 return [prb], [msg]
31
32 issue_url = self.ISSUE_URI.format(issue)
33 refnode = nodes.reference(issue, f"bpo-{issue}", refuri=issue_url)
34 self.set_source_info(refnode)
35 return [refnode], []
36
37
38class GitHubIssue(SphinxRole):

Callers

nothing calls this directly

Calls 2

errorMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected