Skip to content

Commit

Permalink
Add news fragment
Browse files Browse the repository at this point in the history
  • Loading branch information
timj committed Sep 14, 2023
1 parent 8a3a9db commit 2a0ccc3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/changes/DM-22287.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed ``inheritDoc`` to insert newlines between the parent and child docstrings and also correct for indentation differences.
5 changes: 3 additions & 2 deletions python/lsst/utils/inheritDoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ def tmpDecorator(method: type) -> Callable:
parentText = inspect.cleandoc(getattr(klass, methodName).__doc__ or "")

if parentText and appendText:
# Strip so we can ensure that we can insert new lines properly.
method.__doc__ = parentText.rstrip() + "\n\n" + appendText
# cleandoc() strips leading and trailing space so it is safe
# to add new lines.
method.__doc__ = parentText + "\n\n" + appendText
elif parentText:
method.__doc__ = parentText
else:
Expand Down

0 comments on commit 2a0ccc3

Please sign in to comment.