]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fixed linenumber missing when audit hook has an error (GH-24692)
authorJules Lasne <jules.lasne@gmail.com>
Mon, 1 Mar 2021 21:59:58 +0000 (22:59 +0100)
committerGitHub <noreply@github.com>
Mon, 1 Mar 2021 21:59:58 +0000 (22:59 +0100)
See https://github.com/sphinx-doc/sphinx/issues/8932

Co-authored-by: tk0miya <i.tkomiya@gmail.com>
Doc/tools/extensions/pyspecific.py

index 28994399e25cf94e1b4f6513afd3ca9a8c63ace3..bcd9d26b36846fcb0844a566878dc930cb7aa3c2 100644 (file)
@@ -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: