8000 Fix TypeError when docutils can't provide a line · zeehio/sphinx-autodoc2@564b716 · GitHub
[go: up one dir, main page]

Skip to content

Commit 564b716

Browse files
committed
Fix TypeError when docutils can't provide a line
1 parent 5d9e382 commit 564b716

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/autodoc2/sphinx/docstring.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def run(self) -> list[nodes.Node]:
140140
)
141141
document.reporter.get_source_and_line = lambda li: (
142142
source_path,
143-
li + source_offset,
143+
li + source_offset if li is not None else None,
144144
)
145145
with parsing_context():
146146
parser.parse(item["doc"], document)
@@ -215,7 +215,7 @@ def change_source(
215215
state.reporter.source = source_path
216216
state.reporter.get_source_and_line = lambda li: (
217217
source_path,
218-
li + line_offset,
218+
li + line_offset if li is not None else None,
219219
)
220220
yield
221221
finally:

0 commit comments

Comments
 (0)
0