From 1448ecf470013cee63c0682f615c5256928dc6b0 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Fri, 4 Oct 2013 11:38:59 -0400 Subject: Issue #18716: Deprecate the formatter module --- Lib/pydoc.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'Lib/pydoc.py') diff --git a/Lib/pydoc.py b/Lib/pydoc.py index bc644070ae..174311c9a9 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). -- cgit v1.2.1