X Tutup
Skip to content

Commit eaab1ca

Browse files
committed
python#27630: Be consistent in how _XXX/_encoded_XXX vars are initialized.
1 parent 14c7f71 commit eaab1ca

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

Lib/email/generator.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def flatten(self, msg, unixfrom=False, linesep=None):
9797
self._NL = policy.linesep
9898
self._encoded_NL = self._encode(self._NL)
9999
self._EMPTY = ''
100-
self._encoded_EMTPY = self._encode('')
100+
self._encoded_EMPTY = self._encode(self._EMPTY)
101101
# Because we use clone (below) when we recursively process message
102102
# subparts, and because clone uses the computed policy (not None),
103103
# submessages will automatically get set to the computed policy when
@@ -137,10 +137,6 @@ def clone(self, fp):
137137
# it has already transformed the input; but, since this whole thing is a
138138
# hack anyway this seems good enough.
139139

140-
# Similarly, we have _XXX and _encoded_XXX attributes that are used on
141-
# source and buffer data, respectively.
142-
_encoded_EMPTY = ''
143-
144140
def _new_buffer(self):
145141
# BytesGenerator overrides this to return BytesIO.
146142
return StringIO()
@@ -402,10 +398,6 @@ class BytesGenerator(Generator):
402398
The outfp object must accept bytes in its write method.
403399
"""
404400

405-
# Bytes versions of this constant for use in manipulating data from
406-
# the BytesIO buffer.
407-
_encoded_EMPTY = b''
408-
409401
def write(self, s):
410402
self._fp.write(s.encode('ascii', 'surrogateescape'))
411403

0 commit comments

Comments
 (0)
X Tutup