Merge pull request #9 from thekix/master

Using isinstance instead type
This commit is contained in:
Rodolfo García Peñas (kix) 2020-10-12 12:56:58 +02:00 committed by GitHub
commit 4c46cffcc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -482,7 +482,7 @@ class IMAPFolder(BaseFolder):
item[1], flags=re.IGNORECASE): item[1], flags=re.IGNORECASE):
found = item[0] found = item[0]
elif found is not None: elif found is not None:
if type(item) == type(b""): if isinstance(item, bytes):
item = item.decode('utf-8') item = item.decode('utf-8')
uid = re.search("UID\s+(\d+)", item, flags=re.IGNORECASE) uid = re.search("UID\s+(\d+)", item, flags=re.IGNORECASE)
if uid: if uid: