Skip to content

Commit 037bd31

Browse files
committed
Ignore MultipartInvariantViolationDefect for message body if only considering the headers
1 parent 3ef320b commit 037bd31

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/email/feedparser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def close(self):
189189
assert not self._msgstack
190190
# Look for final set of defects
191191
if root.get_content_maintype() == 'multipart' \
192-
and not root.is_multipart():
192+
and not root.is_multipart() and not self._headersonly:
193193
defect = errors.MultipartInvariantViolationDefect()
194194
self.policy.handle_defect(root, defect)
195195
return root

0 commit comments

Comments
 (0)