diff options
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/formatter.py | 3 | ||||
-rwxr-xr-x | Lib/pydoc.py | 9 |
2 files changed, 7 insertions, 5 deletions
diff --git a/Lib/formatter.py b/Lib/formatter.py index 60e60f1..d8cca52 100644 --- a/Lib/formatter.py +++ b/Lib/formatter.py @@ -19,6 +19,9 @@ manage and inserting data into the output. """ import sys +import warnings +warnings.warn('the formatter module is deprecated and will be removed in ' + 'Python 3.6', PendingDeprecationWarning) AS_IS = None 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). |