summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2004-05-11 18:10:15 (GMT)
committerBarry Warsaw <barry@python.org>2004-05-11 18:10:15 (GMT)
commit5b44cd64d7a05b2f31c927e2b784789a8094a270 (patch)
tree81375137a396d7ec03963cbeffe975be9afe19db
parent2e7c8328ae637b3c8fbb693fdd5ffd2de01e1256 (diff)
downloadcpython-5b44cd64d7a05b2f31c927e2b784789a8094a270.zip
cpython-5b44cd64d7a05b2f31c927e2b784789a8094a270.tar.gz
cpython-5b44cd64d7a05b2f31c927e2b784789a8094a270.tar.bz2
_parsegen(): Watch out for empty epilogues.
-rw-r--r--Lib/email/FeedParser.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/email/FeedParser.py b/Lib/email/FeedParser.py
index 806277f..c980f9a 100644
--- a/Lib/email/FeedParser.py
+++ b/Lib/email/FeedParser.py
@@ -365,10 +365,11 @@ class FeedParser:
# Any CRLF at the front of the epilogue is not technically part of
# the epilogue. Also, watch out for an empty string epilogue,
# which means a single newline.
- firstline = epilogue[0]
- bolmo = NLCRE_bol.match(firstline)
- if bolmo:
- epilogue[0] = firstline[len(bolmo.group(0)):]
+ if epilogue:
+ firstline = epilogue[0]
+ bolmo = NLCRE_bol.match(firstline)
+ if bolmo:
+ epilogue[0] = firstline[len(bolmo.group(0)):]
self._cur.epilogue = EMPTYSTRING.join(epilogue)
return
# Otherwise, it's some non-multipart type, so the entire rest of the