]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fixed linenumber missing when audit hook has an error (GH-24692)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 1 Mar 2021 22:23:21 +0000 (14:23 -0800)
committerGitHub <noreply@github.com>
Mon, 1 Mar 2021 22:23:21 +0000 (14:23 -0800)
See https://github.com/sphinx-doc/sphinx/issues/8932

Co-authored-by: tk0miya <i.tkomiya@gmail.com>
(cherry picked from commit dbfabcc0c306742e34b9b0e162c63ccebe9d2b05)

Co-authored-by: Jules Lasne <jules.lasne@gmail.com>
Doc/tools/extensions/pyspecific.py

index 2fad9ec00cd568b0025d1ce4caa45f25465e1a47..74de6ffa75559ede50e98e0e23f11c1c3b466dd4 100644 (file)
@@ -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: