diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2018-07-23 05:37:47 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-23 05:37:47 (GMT) |
commit | d04f46c59f1d07d9bcc0ba910741296ac88d370d (patch) | |
tree | aa99a6034da99ca0346a6275364dab6b9c466a20 /Lib/pydoc.py | |
parent | 1426daa4fe47d8f8be0d416f7cba7adae1d5839f (diff) | |
download | cpython-d04f46c59f1d07d9bcc0ba910741296ac88d370d.zip cpython-d04f46c59f1d07d9bcc0ba910741296ac88d370d.tar.gz cpython-d04f46c59f1d07d9bcc0ba910741296ac88d370d.tar.bz2 |
bpo-940286: Fix pydoc to show cross refs correctly (GH-8390)
Diffstat (limited to 'Lib/pydoc.py')
-rw-r--r-- | Lib/pydoc.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 199745c..8a6b27b 100644 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -2028,14 +2028,15 @@ module "pydoc_data.topics" could not be found. except KeyError: self.output.write('no documentation found for %s\n' % repr(topic)) return - pager(doc.strip() + '\n') + doc = doc.strip() + '\n' if more_xrefs: xrefs = (xrefs or '') + ' ' + more_xrefs if xrefs: import textwrap text = 'Related help topics: ' + ', '.join(xrefs.split()) + '\n' wrapped_text = textwrap.wrap(text, 72) - self.output.write('\n%s\n' % ''.join(wrapped_text)) + doc += '\n%s\n' % '\n'.join(wrapped_text) + pager(doc) def _gettopic(self, topic, more_xrefs=''): """Return unbuffered tuple of (topic, xrefs). |