[PATCH] Don't require the string module

Sebastian Spaeth Sebastian at SSpaeth.de
Mon Jan 31 14:50:18 GMT 2011


There is no need for using the string module if all we want is to split
a string at the white space. All pythons since at least 2.4 can do that.

Signed-off-by: Sebastian Spaeth <Sebastian at SSpaeth.de>
---
Another minor cleanup against the master branch.

 offlineimap/folder/IMAP.py |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/offlineimap/folder/IMAP.py b/offlineimap/folder/IMAP.py
index 76f0c4a..8300567 100644
--- a/offlineimap/folder/IMAP.py
+++ b/offlineimap/folder/IMAP.py
@@ -18,7 +18,6 @@
 
 import imaplib
 import rfc822
-import string
 import random
 import binascii
 import re
@@ -111,7 +110,7 @@ class IMAPFolder(BaseFolder):
             self.imapserver.releaseconnection(imapobj)
 
         # Discard the message number.
-        messagestr = string.split(response[0], maxsplit = 1)[1]
+        messagestr = response[0].split(' ', 1)[1]
         options = imaputil.flags2hash(messagestr)
         if not options.has_key('UID'):
             return True
@@ -194,7 +193,7 @@ class IMAPFolder(BaseFolder):
             self.imapserver.releaseconnection(imapobj)
         for messagestr in response:
             # Discard the message number.
-            messagestr = string.split(messagestr, maxsplit = 1)[1]
+            messagestr = messagestr.split(' ', 1)[1]
             options = imaputil.flags2hash(messagestr)
             if not options.has_key('UID'):
                 self.ui.warn('No UID in message with options %s' %\
-- 
1.7.1





More information about the OfflineIMAP-project mailing list