Skip to content
Merged
Show file tree
Hide file tree
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
Add a newline after the docstring of unclassified object.
  • Loading branch information
serhiy-storchaka committed Apr 17, 2020
commit fe96fea6d5e238c745de0cc92f6721d83923bc50
2 changes: 1 addition & 1 deletion Lib/pydoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1445,7 +1445,7 @@ def docother(self, object, name=None, mod=None, parent=None, maxlen=None, doc=No
if not doc:
doc = getdoc(object)
if doc:
line += '\n' + self.indent(str(doc))
line += '\n' + self.indent(str(doc)) + '\n'
return line

class _PlainTextDoc(TextDoc):
Expand Down
3 changes: 2 additions & 1 deletion Lib/test/test_pydoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1255,7 +1255,8 @@ class X:
X.attr.__doc__ = 'Custom descriptor'
self.assertEqual(self._get_summary_lines(X.attr), """\
<test.test_pydoc.TestDescriptions.test_custom_non_data_descriptor.<locals>.Descr object>
Custom descriptor""")
Custom descriptor
""")

X.attr.__name__ = 'foo'
self.assertEqual(self._get_summary_lines(X.attr), """\
Expand Down