summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-07-23 06:51:28 (GMT)
committerGitHub <noreply@github.com>2018-07-23 06:51:28 (GMT)
commite9e6495eedd7fb588964ffa50e8bf2c5ce9c6051 (patch)
tree0b8f583278b1a84e4cda4d51c2816e3dab63df9b /Lib
parent0ff174643437f34c50c8625462b5419b1a643b57 (diff)
downloadcpython-e9e6495eedd7fb588964ffa50e8bf2c5ce9c6051.zip
cpython-e9e6495eedd7fb588964ffa50e8bf2c5ce9c6051.tar.gz
cpython-e9e6495eedd7fb588964ffa50e8bf2c5ce9c6051.tar.bz2
bpo-940286: Fix pydoc to show cross refs correctly (GH-8390)
(cherry picked from commit d04f46c59f1d07d9bcc0ba910741296ac88d370d) Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
Diffstat (limited to 'Lib')
-rw-r--r--Lib/pydoc.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index 8c70754..fffa2d5 100644
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -1992,14 +1992,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).