Merge pull request #7 from patrickdepinguin/py3fix
More python 3 related fixes
This commit is contained in:
commit
d8149c1ec1
@ -459,8 +459,9 @@ class SyncableAccount(Account):
|
|||||||
p = Popen(cmd, shell=True,
|
p = Popen(cmd, shell=True,
|
||||||
stdin=PIPE, stdout=PIPE, stderr=PIPE,
|
stdin=PIPE, stdout=PIPE, stderr=PIPE,
|
||||||
close_fds=True)
|
close_fds=True)
|
||||||
r = p.communicate()
|
stdout, stderr = p.communicate()
|
||||||
self.ui.callhook("Hook stdout: %s\nHook stderr:%s\n" % r)
|
self.ui.callhook("Hook stdout: %s\nHook stderr:%s\n"
|
||||||
|
% (stdout.decode('utf-8'), stderr.decode('utf-8')))
|
||||||
self.ui.callhook("Hook return code: %d" % p.returncode)
|
self.ui.callhook("Hook return code: %d" % p.returncode)
|
||||||
except (KeyboardInterrupt, SystemExit):
|
except (KeyboardInterrupt, SystemExit):
|
||||||
raise
|
raise
|
||||||
|
@ -482,7 +482,8 @@ 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(""):
|
if type(item) == type(b""):
|
||||||
|
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:
|
||||||
return int(uid.group(1))
|
return int(uid.group(1))
|
||||||
|
Loading…
Reference in New Issue
Block a user