mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #18716: Deprecate the formatter module
This commit is contained in:
parent
cc5d49e3da
commit
1448ecf470
5 changed files with 19 additions and 8 deletions
|
@ -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).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue