]> granicus.if.org Git - python/commitdiff
Fix bug in _checkquote that raised an exception on empty "arg".
authorPiers Lauder <piers@cs.su.oz.au>
Fri, 8 Oct 2004 04:05:39 +0000 (04:05 +0000)
committerPiers Lauder <piers@cs.su.oz.au>
Fri, 8 Oct 2004 04:05:39 +0000 (04:05 +0000)
Lib/imaplib.py

index 6a747285b91d41bec3818f1825409a8ddb28d7da..f353015c935d9626e42f4833e50a2ecd27598f73 100644 (file)
@@ -1008,9 +1008,9 @@ class IMAP4:
 
         if type(arg) is not type(''):
             return arg
-        if (arg[0],arg[-1]) in (('(',')'),('"','"')):
+        if len(arg) >= 2 and (arg[0],arg[-1]) in (('(',')'),('"','"')):
             return arg
-        if self.mustquote.search(arg) is None:
+        if arg and self.mustquote.search(arg) is None:
             return arg
         return self._quote(arg)