var name syntax error
This commit is contained in:
parent
06e863f739
commit
e0959fb9c6
1 changed files with 2 additions and 2 deletions
|
@ -40,7 +40,7 @@ import gnupg
|
|||
|
||||
# constants
|
||||
DEFAULT_ENCODING='utf-8' # default is latin-1 which fails w some unicode chars
|
||||
CONTENT-TRANSFER-ENCODING_TO_ENCODER_DICT = {
|
||||
CTE_TO_ENCODER_DICT = {
|
||||
"7bit": email.encoders.encode_7or8bit,
|
||||
"8bit": email.encoders.encode_7or8bit,
|
||||
"base64": email.encoders.encode_base64,
|
||||
|
@ -69,7 +69,7 @@ def get_encoder_from_msg(msg: email.message.Message) -> function:
|
|||
"""
|
||||
cte = msg.get("Content-Transfer-Encoding")
|
||||
if cte:
|
||||
encoder = CONTENT-TRANSFER-ENCODING_TO_ENCODER_DICT.get(cte)
|
||||
encoder = CTE_TO_ENCODER_DICT.get(cte)
|
||||
else:
|
||||
return DEFAULT_ENCODER
|
||||
return encoder if encoder else DEFAULT_ENCODER
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue