Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix TypeError when docutils can't provide a line
  • Loading branch information
zeehio committed Sep 22, 2024
commit 564b7169da59bbe154deb380b99c4ffae72dcc60
4 changes: 2 additions & 2 deletions src/autodoc2/sphinx/docstring.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def run(self) -> list[nodes.Node]:
)
document.reporter.get_source_and_line = lambda li: (
source_path,
li + source_offset,
li + source_offset if li is not None else None,
)
with parsing_context():
parser.parse(item["doc"], document)
Expand Down Expand Up @@ -215,7 +215,7 @@ def change_source(
state.reporter.source = source_path
state.reporter.get_source_and_line = lambda li: (
source_path,
li + line_offset,
li + line_offset if li is not None else None,
)
yield
finally:
Expand Down