diff options
author | Brett Cannon <brett@python.org> | 2013-10-04 15:38:59 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2013-10-04 15:38:59 (GMT) |
commit | 1448ecf470013cee63c0682f615c5256928dc6b0 (patch) | |
tree | bd8650fbd71fe3aee320e8be61f87b78893c3142 /Lib/pydoc.py | |
parent | cc5d49e3daeeef7809dcc93a22f0e5185961185f (diff) | |
download | cpython-1448ecf470013cee63c0682f615c5256928dc6b0.zip cpython-1448ecf470013cee63c0682f615c5256928dc6b0.tar.gz cpython-1448ecf470013cee63c0682f615c5256928dc6b0.tar.bz2 |
Issue #18716: Deprecate the formatter module
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-x | Lib/pydoc.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py index bc64407..174311c 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -1915,11 +1915,10 @@ module "pydoc_data.topics" could not be found. if more_xrefs: xrefs = (xrefs or '') + ' ' + more_xrefs if xrefs: - import formatter - buffer = io.StringIO() - formatter.DumbWriter(buffer).send_flowing_data( - 'Related help topics: ' + ', '.join(xrefs.split()) + '\n') - self.output.write('\n%s\n' % buffer.getvalue()) + 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)) def _gettopic(self, topic, more_xrefs=''): """Return unbuffered tuple of (topic, xrefs). |