Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5b44cd6

Browse files
committed
_parsegen(): Watch out for empty epilogues.
1 parent 2e7c832 commit 5b44cd6

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

Lib/email/FeedParser.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -365,10 +365,11 @@ def _parsegen(self):
365365
# Any CRLF at the front of the epilogue is not technically part of
366366
# the epilogue. Also, watch out for an empty string epilogue,
367367
# which means a single newline.
368-
firstline = epilogue[0]
369-
bolmo = NLCRE_bol.match(firstline)
370-
if bolmo:
371-
epilogue[0] = firstline[len(bolmo.group(0)):]
368+
if epilogue:
369+
firstline = epilogue[0]
370+
bolmo = NLCRE_bol.match(firstline)
371+
if bolmo:
372+
epilogue[0] = firstline[len(bolmo.group(0)):]
372373
self._cur.epilogue = EMPTYSTRING.join(epilogue)
373374
return
374375
# Otherwise, it's some non-multipart type, so the entire rest of the

0 commit comments

Comments
 (0)