Fixes error (#5902)

Fixes "TypeError: cannot use a string pattern on a bytes-like object"
This commit is contained in:
Benji 2018-08-07 17:14:40 +08:00 committed by Rushabh Mehta
parent d9e7654602
commit 0330499bb9

View file

@ -225,7 +225,7 @@ class EmailServer:
def parse_imap_responce(self, cmd, responce):
pattern = r"(?<={cmd} )[0-9]*".format(cmd=cmd)
match = re.search(pattern, responce, re.U | re.I)
match = re.search(pattern, responce.decode('utf-8'), re.U | re.I)
if match:
return match.group(0)
else: