Unverified Kaydet (Commit) d04f46c5 authored tarafından Berker Peksag's avatar Berker Peksag Kaydeden (comit) GitHub

bpo-940286: Fix pydoc to show cross refs correctly (GH-8390)

üst 1426daa4
......@@ -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).
......
pydoc's ``Helper.showtopic()`` method now prints the cross references of a
topic correctly.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment