summaryrefslogtreecommitdiffstats
path: root/Lib/email
diff options
context:
space:
mode:
authorPhilip Jenvey <pjenvey@underboss.org>2012-10-01 19:53:43 (GMT)
committerPhilip Jenvey <pjenvey@underboss.org>2012-10-01 19:53:43 (GMT)
commit4993cc0a5b34dc91da2b41c50e33d809f0191355 (patch)
tree5f4a1327469a43d4bbaa876e13e22a316731775d /Lib/email
parent075bbb176f69e3da013e39d847caaea9b0cee334 (diff)
downloadcpython-4993cc0a5b34dc91da2b41c50e33d809f0191355.zip
cpython-4993cc0a5b34dc91da2b41c50e33d809f0191355.tar.gz
cpython-4993cc0a5b34dc91da2b41c50e33d809f0191355.tar.bz2
utilize yield from
Diffstat (limited to 'Lib/email')
-rw-r--r--Lib/email/_header_value_parser.py3
-rw-r--r--Lib/email/iterators.py6
2 files changed, 3 insertions, 6 deletions
diff --git a/Lib/email/_header_value_parser.py b/Lib/email/_header_value_parser.py
index 1924ed1..b596462 100644
--- a/Lib/email/_header_value_parser.py
+++ b/Lib/email/_header_value_parser.py
@@ -367,8 +367,7 @@ class TokenList(list):
yield (indent + ' !! invalid element in token '
'list: {!r}'.format(token))
else:
- for line in token._pp(indent+' '):
- yield line
+ yield from token._pp(indent+' ')
if self.defects:
extra = ' Defects: {}'.format(self.defects)
else:
diff --git a/Lib/email/iterators.py b/Lib/email/iterators.py
index 3adc4a0..b5502ee 100644
--- a/Lib/email/iterators.py
+++ b/Lib/email/iterators.py
@@ -26,8 +26,7 @@ def walk(self):
yield self
if self.is_multipart():
for subpart in self.get_payload():
- for subsubpart in subpart.walk():
- yield subsubpart
+ yield from subpart.walk()
@@ -40,8 +39,7 @@ def body_line_iterator(msg, decode=False):
for subpart in msg.walk():
payload = subpart.get_payload(decode=decode)
if isinstance(payload, str):
- for line in StringIO(payload):
- yield line
+ yield from StringIO(payload)
def typed_subpart_iterator(msg, maintype='text', subtype=None):