Browse Source

text var could be undefined

Phyks (Lucas Verney) 5 years ago
parent
commit
338672624d
1 changed files with 1 additions and 0 deletions
  1. 1
    0
      emails_sms_free.py

+ 1
- 0
emails_sms_free.py View File

@@ -83,6 +83,7 @@ def get_emails(imap_server, imap_user, imap_password, inbox, uid):
83 83
             for i in diff_msg_ids:
84 84
                 typ, msg_data = conn.uid('fetch', i, '(RFC822)')
85 85
                 msg_parsed = email.message_from_bytes(msg_data[0][1])
86
+                text = ""
86 87
                 for part in msg_parsed.walk():
87 88
                     if part.get_content_charset() is None:
88 89
                         # We cannot know the character set, so return decoded "something"