dict.has_key(a) --> a in dict

has_key() is gone in python3, so use a more modern syntax here.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
Sebastian Spaeth
2012-02-05 13:40:06 +01:00
parent 8aba2800e6
commit 5c598d7e74
5 changed files with 8 additions and 8 deletions

View File

@ -186,7 +186,7 @@ class IMAPFolder(BaseFolder):
continue
messagestr = messagestr.split(' ', 1)[1]
options = imaputil.flags2hash(messagestr)
if not options.has_key('UID'):
if not 'UID' in options:
self.ui.warn('No UID in message with options %s' %\
str(options),
minor = 1)

View File

@ -94,7 +94,7 @@ class MappedIMAPFolder(IMAPFolder):
# summary that have been deleted from the folder.
for luid in self.diskl2r.keys():
if not reallist.has_key(luid):
if not luid in reallist:
ruid = self.diskl2r[luid]
del self.diskr2l[ruid]
del self.diskl2r[luid]
@ -107,7 +107,7 @@ class MappedIMAPFolder(IMAPFolder):
self.l2r = self.diskl2r.copy()
for luid in reallist.keys():
if not self.l2r.has_key(luid):
if not luid in self.l2r:
ruid = nextneg
nextneg -= 1
self.l2r[luid] = ruid