From: Jules Lasne Date: Mon, 1 Mar 2021 21:59:58 +0000 (+0100) Subject: Fixed linenumber missing when audit hook has an error (GH-24692) X-Git-Tag: v3.10.0a7~222 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dbfabcc0c306742e34b9b0e162c63ccebe9d2b05;p=thirdparty%2FPython%2Fcpython.git Fixed linenumber missing when audit hook has an error (GH-24692) See https://github.com/sphinx-doc/sphinx/issues/8932 Co-authored-by: tk0miya --- diff --git a/Doc/tools/extensions/pyspecific.py b/Doc/tools/extensions/pyspecific.py index 28994399e25c..bcd9d26b3684 100644 --- a/Doc/tools/extensions/pyspecific.py +++ b/Doc/tools/extensions/pyspecific.py @@ -224,6 +224,7 @@ class AuditEvent(Directive): info['source'].append((env.docname, target)) pnode = nodes.paragraph(text, classes=["audit-hook"], ids=ids) + pnode.line = self.lineno if self.content: self.state.nested_parse(self.content, self.content_offset, pnode) else: