mirror of https://github.com/python/cpython
bpo-46544: Do not leak `x` and `uspace` in textwrap.TextWrapper (GH-30955)
This commit is contained in:
parent
08c0ed2d9c
commit
82bce54614
|
@ -63,10 +63,7 @@ class TextWrapper:
|
|||
Append to the last line of truncated text.
|
||||
"""
|
||||
|
||||
unicode_whitespace_trans = {}
|
||||
uspace = ord(' ')
|
||||
for x in _whitespace:
|
||||
unicode_whitespace_trans[ord(x)] = uspace
|
||||
unicode_whitespace_trans = dict.fromkeys(map(ord, _whitespace), ord(' '))
|
||||
|
||||
# This funky little regex is just the trick for splitting
|
||||
# text up into word-wrappable chunks. E.g.
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
Don't leak ``x`` & ``uspace`` intermediate vars in
|
||||
:class:`textwrap.TextWrapper`.
|
Loading…
Reference in New Issue