From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Mon, 1 Mar 2021 22:23:21 +0000 (-0800) Subject: Fixed linenumber missing when audit hook has an error (GH-24692) X-Git-Tag: v3.9.3~68 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff887f38f6bb438bac3a4b02aaac1d56c6077418;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 (cherry picked from commit dbfabcc0c306742e34b9b0e162c63ccebe9d2b05) Co-authored-by: Jules Lasne --- diff --git a/Doc/tools/extensions/pyspecific.py b/Doc/tools/extensions/pyspecific.py index 2fad9ec00cd5..74de6ffa7555 100644 --- a/Doc/tools/extensions/pyspecific.py +++ b/Doc/tools/extensions/pyspecific.py @@ -191,6 +191,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: