diff options
author | R David Murray <rdmurray@bitdance.com> | 2016-09-09 02:27:39 (GMT) |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2016-09-09 02:27:39 (GMT) |
commit | f03bcfd168290604914b38c718a374aa9fad166d (patch) | |
tree | 406bc55bcefedc3522bf6214e8f19a438b433037 /Lib/email | |
parent | 71c01d43a7839bfd1ec30991805af9bc41f3fafd (diff) | |
parent | eaab1ca5586a824fa850ee705fdead46a28b4684 (diff) | |
download | cpython-f03bcfd168290604914b38c718a374aa9fad166d.zip cpython-f03bcfd168290604914b38c718a374aa9fad166d.tar.gz cpython-f03bcfd168290604914b38c718a374aa9fad166d.tar.bz2 |
Merge: #27630: Be consistent in how _XXX/_encoded_XXX vars are initialized.
Diffstat (limited to 'Lib/email')
-rw-r--r-- | Lib/email/generator.py | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/Lib/email/generator.py b/Lib/email/generator.py index ae42cdf..51109f9 100644 --- a/Lib/email/generator.py +++ b/Lib/email/generator.py @@ -97,7 +97,7 @@ class Generator: self._NL = policy.linesep self._encoded_NL = self._encode(self._NL) self._EMPTY = '' - self._encoded_EMPTY = self._encode('') + self._encoded_EMPTY = self._encode(self._EMPTY) # Because we use clone (below) when we recursively process message # subparts, and because clone uses the computed policy (not None), # submessages will automatically get set to the computed policy when @@ -137,10 +137,6 @@ class Generator: # it has already transformed the input; but, since this whole thing is a # hack anyway this seems good enough. - # Similarly, we have _XXX and _encoded_XXX attributes that are used on - # source and buffer data, respectively. - _encoded_EMPTY = '' - def _new_buffer(self): # BytesGenerator overrides this to return BytesIO. return StringIO() @@ -402,10 +398,6 @@ class BytesGenerator(Generator): The outfp object must accept bytes in its write method. """ - # Bytes versions of this constant for use in manipulating data from - # the BytesIO buffer. - _encoded_EMPTY = b'' - def write(self, s): self._fp.write(s.encode('ascii', 'surrogateescape')) |