Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update Lib/email/mime/image.py
I like it, thanks.

Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
  • Loading branch information
warsaw and arhadthedev authored Apr 14, 2022
commit 0bb942c077da08cbeaaf84d8cdeea692a28eca87
4 changes: 2 additions & 2 deletions Lib/email/mime/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ def __init__(self, _imagedata, _subtype=None,
constructor, which turns them into parameters on the Content-Type
header.
"""
_subtype = _what(_imagedata) if _subtype is None else _subtype
if _subtype is None:
if (_subtype := _what(_imagedata)) is None:
raise TypeError('Could not guess image MIME subtype')
raise TypeError('Could not guess image MIME subtype')
MIMENonMultipart.__init__(self, 'image', _subtype, policy=policy,
**_params)
self.set_payload(_imagedata)
Expand Down