mirror of
https://github.com/python/cpython.git
synced 2026-05-06 20:51:17 -04:00
bpo-46544: Do not leak x and uspace in textwrap.TextWrapper (GH-30955)
This commit is contained in:
+1
-4
@@ -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`.
|
||||
Reference in New Issue
Block a user