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,
|
||||
stdin=PIPE, stdout=PIPE, stderr=PIPE,
|
||||
close_fds=True)
|
||||
r = p.communicate()
|
||||
self.ui.callhook("Hook stdout: %s\nHook stderr:%s\n" % r)
|
||||
stdout, stderr = p.communicate()
|
||||
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)
|
||||
except (KeyboardInterrupt, SystemExit):
|
||||
raise
|
||||
|
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user