_parsegen(): Watch out for empty epilogues.

This commit is contained in:
Barry Warsaw 2004-05-11 18:10:15 +00:00
parent 2e7c8328ae
commit 5b44cd64d7
1 changed files with 5 additions and 4 deletions

View 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