summaryrefslogtreecommitdiff
path: root/Lib/email/header.py
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2007-08-30 14:28:55 +0000
committerBarry Warsaw <barry@python.org>2007-08-30 14:28:55 +0000
commit2cc1f6d95b11f017f04921ea33a5cfc369e32e97 (patch)
tree0af4321c600f82fed75258c753ac71e1ed6588f0 /Lib/email/header.py
parent5a23cc5a01458c74f8c849f41c2aea0151716668 (diff)
downloadcpython-git-2cc1f6d95b11f017f04921ea33a5cfc369e32e97.tar.gz
More email package related repairs. This fixes smtplib's import and use of
email.base64mime, but test_smtplib still has failures for me. They are timeout errors so think they're more related to my current wacky network setup than bugs remaining in the code related to the email package. This also r57693 that got clobbered with the sandbox sync, and fixes a couple of other minor problems that cropped up. I will kill the sandbox branch next. The email package now has 11F/11E.
Diffstat (limited to 'Lib/email/header.py')
-rw-r--r--Lib/email/header.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/email/header.py b/Lib/email/header.py
index e03e42d6c1..786a71f647 100644
--- a/Lib/email/header.py
+++ b/Lib/email/header.py
@@ -341,10 +341,11 @@ class _ValueFormatter:
self._current_line = _Accumulator(headerlen)
def __str__(self):
- # Remove the trailing TRANSITIONAL_SPACE
- last_line = self._current_line.pop()
- if last_line is not TRANSITIONAL_SPACE:
- self._current_line.push(last_line)
+ # Remove any trailing TRANSITIONAL_SPACE
+ if len(self._current_line) > 0:
+ last_line = self._current_line.pop()
+ if last_line is not TRANSITIONAL_SPACE:
+ self._current_line.push(last_line)
self.newline()
return NL.join(self._lines)