Merge pull request #7 from patrickdepinguin/py3fix

More python 3 related fixes
This commit is contained in:
Rodolfo García Peñas (kix)
2020-10-12 12:44:19 +02:00
committed by GitHub
2 changed files with 5 additions and 3 deletions

View File

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