summaryrefslogtreecommitdiffstats
path: root/Lib/email
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/email')
-rw-r--r--Lib/email/iterators.py4
-rw-r--r--Lib/email/test/test_email.py7
-rw-r--r--Lib/email/test/test_email_renamed.py7
3 files changed, 8 insertions, 10 deletions
diff --git a/Lib/email/iterators.py b/Lib/email/iterators.py
index 4f2c84c..155e19e 100644
--- a/Lib/email/iterators.py
+++ b/Lib/email/iterators.py
@@ -63,9 +63,9 @@ def _structure(msg, fp=None, level=0, include_default=False):
if fp is None:
fp = sys.stdout
tab = ' ' * (level * 4)
- print(tab + msg.get_content_type(), end=' ', file=fp)
+ print(tab + msg.get_content_type(), end='', file=fp)
if include_default:
- print('[%s]' % msg.get_default_type(), file=fp)
+ print(' [%s]' % msg.get_default_type(), file=fp)
else:
print(file=fp)
if msg.is_multipart():
diff --git a/Lib/email/test/test_email.py b/Lib/email/test/test_email.py
index 0a25a67..c3269d7 100644
--- a/Lib/email/test/test_email.py
+++ b/Lib/email/test/test_email.py
@@ -54,10 +54,9 @@ class TestEmailBase(unittest.TestCase):
if first != second:
sfirst = str(first)
ssecond = str(second)
- diff = difflib.ndiff(sfirst.splitlines(), ssecond.splitlines())
- fp = StringIO()
- print(NL, NL.join(diff), file=fp)
- raise self.failureException, fp.getvalue()
+ diff = difflib.ndiff(sfirst.splitlines(True),
+ ssecond.splitlines(True))
+ raise self.failureException(NL + "".join(diff))
def _msgobj(self, filename):
fp = openfile(findfile(filename))
diff --git a/Lib/email/test/test_email_renamed.py b/Lib/email/test/test_email_renamed.py
index 532b146..21061b0 100644
--- a/Lib/email/test/test_email_renamed.py
+++ b/Lib/email/test/test_email_renamed.py
@@ -55,10 +55,9 @@ class TestEmailBase(unittest.TestCase):
if first != second:
sfirst = str(first)
ssecond = str(second)
- diff = difflib.ndiff(sfirst.splitlines(), ssecond.splitlines())
- fp = StringIO()
- print(NL, NL.join(diff), file=fp)
- raise self.failureException, fp.getvalue()
+ diff = difflib.ndiff(sfirst.splitlines(True),
+ ssecond.splitlines(True))
+ raise self.failureException(NL + "".join(diff))
def _msgobj(self, filename):
fp = openfile(findfile(filename))