]> granicus.if.org Git - python/commitdiff
_parsegen(): Watch out for empty epilogues.
authorBarry Warsaw <barry@python.org>
Tue, 11 May 2004 18:10:15 +0000 (18:10 +0000)
committerBarry Warsaw <barry@python.org>
Tue, 11 May 2004 18:10:15 +0000 (18:10 +0000)
Lib/email/FeedParser.py

index 806277f08210dff88f2cba6cc8afd801a66d5dfb..c980f9a328dfcec1ae2c84830d9d53bbf2920aed 100644 (file)
@@ -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