mirror of https://github.com/python/cpython
[3.13] GH-121970: Fix ``gettext`` for audit events (GH-122651) (#122653)
GH-121970: Fix ``gettext`` for audit events (GH-122651)
(cherry picked from commit 95f5c89b54
)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
This commit is contained in:
parent
57ba3b0c6e
commit
4210a7d02b
|
@ -149,6 +149,7 @@ class AuditEvent(SphinxDirective):
|
||||||
node = nodes.paragraph("", classes=["audit-hook"], ids=ids)
|
node = nodes.paragraph("", classes=["audit-hook"], ids=ids)
|
||||||
self.set_source_info(node)
|
self.set_source_info(node)
|
||||||
if self.content:
|
if self.content:
|
||||||
|
node.rawsource = '\n'.join(self.content) # for gettext
|
||||||
self.state.nested_parse(self.content, self.content_offset, node)
|
self.state.nested_parse(self.content, self.content_offset, node)
|
||||||
else:
|
else:
|
||||||
num_args = min(2, len(args))
|
num_args = min(2, len(args))
|
||||||
|
@ -156,6 +157,7 @@ class AuditEvent(SphinxDirective):
|
||||||
name=f"``{name}``",
|
name=f"``{name}``",
|
||||||
args=", ".join(f"``{a}``" for a in args),
|
args=", ".join(f"``{a}``" for a in args),
|
||||||
)
|
)
|
||||||
|
node.rawsource = text # for gettext
|
||||||
parsed, messages = self.state.inline_text(text, self.lineno)
|
parsed, messages = self.state.inline_text(text, self.lineno)
|
||||||
node += parsed
|
node += parsed
|
||||||
node += messages
|
node += messages
|
||||||
|
|
Loading…
Reference in New Issue