Use more specific exception type for imap decoding (#104227)

* Use more specific exception type for imap decoding

* Only catch ValueError
pull/104276/head
Jan Bouwhuis 2023-11-20 19:55:10 +01:00 committed by GitHub
parent 80f8e76fa3
commit 4da77d2253
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -167,7 +167,7 @@ class ImapMessage:
"""
try:
return str(part.get_payload(decode=True).decode(self._charset))
except Exception: # pylint: disable=broad-except
except ValueError:
return str(part.get_payload())
part: Message