diff --git a/offlineimap/folder/IMAP.py b/offlineimap/folder/IMAP.py index 0bbe746..d06c740 100644 --- a/offlineimap/folder/IMAP.py +++ b/offlineimap/folder/IMAP.py @@ -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) diff --git a/offlineimap/folder/UIDMaps.py b/offlineimap/folder/UIDMaps.py index 36e92af..f306459 100644 --- a/offlineimap/folder/UIDMaps.py +++ b/offlineimap/folder/UIDMaps.py @@ -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 diff --git a/offlineimap/imaplibutil.py b/offlineimap/imaplibutil.py index 2d5fc39..2aa81d9 100644 --- a/offlineimap/imaplibutil.py +++ b/offlineimap/imaplibutil.py @@ -137,7 +137,7 @@ class WrappedIMAP4_SSL(UsefulIMAPMixIn, IMAP4_SSL): """Improved version of imaplib.IMAP4_SSL overriding select()""" def __init__(self, *args, **kwargs): self._fingerprint = kwargs.get('fingerprint', None) - if kwargs.has_key('fingerprint'): + if 'fingerprint' in kwargs: del kwargs['fingerprint'] super(WrappedIMAP4_SSL, self).__init__(*args, **kwargs) diff --git a/offlineimap/threadutil.py b/offlineimap/threadutil.py index 054fa11..a29e68f 100644 --- a/offlineimap/threadutil.py +++ b/offlineimap/threadutil.py @@ -209,7 +209,7 @@ def initInstanceLimit(instancename, instancemax): """Initialize the instance-limited thread implementation to permit up to intancemax threads with the given instancename.""" instancelimitedlock.acquire() - if not instancelimitedsems.has_key(instancename): + if not instancename in instancelimitedsems: instancelimitedsems[instancename] = BoundedSemaphore(instancemax) instancelimitedlock.release() diff --git a/offlineimap/ui/UIBase.py b/offlineimap/ui/UIBase.py index bf46e6f..a8aeeaf 100644 --- a/offlineimap/ui/UIBase.py +++ b/offlineimap/ui/UIBase.py @@ -159,7 +159,7 @@ class UIBase(object): def unregisterthread(self, thr): """Unregister a thread as being associated with an account name""" - if self.threadaccounts.has_key(thr): + if thr in self.threadaccounts: del self.threadaccounts[thr] self.debug('thread', "Unregister thread '%s'" % thr.getName()) @@ -175,7 +175,7 @@ class UIBase(object): def debug(self, debugtype, msg): cur_thread = threading.currentThread() - if not self.debugmessages.has_key(cur_thread): + if not cur_thread in self.debugmessages: # deque(..., self.debugmsglen) would be handy but was # introduced in p2.6 only, so we'll need to work around and # shorten our debugmsg list manually :-( @@ -403,7 +403,7 @@ class UIBase(object): ################################################## Threads def getThreadDebugLog(self, thread): - if self.debugmessages.has_key(thread): + if thread in self.debugmessages: message = "\nLast %d debug messages logged for %s prior to exception:\n"\ % (len(self.debugmessages[thread]), thread.getName()) message += "\n".join(self.debugmessages[thread])