diff options
author | Piers Lauder <piers@cs.su.oz.au> | 2004-10-08 04:05:39 (GMT) |
---|---|---|
committer | Piers Lauder <piers@cs.su.oz.au> | 2004-10-08 04:05:39 (GMT) |
commit | c09acfda778bba61267708458d12268aa5fecc62 (patch) | |
tree | 6eea02ac440e859e9f90e734ecb12f1081f6c250 /Lib | |
parent | 77d110d6b8b714c87e9850239166d14d62fc243b (diff) | |
download | cpython-c09acfda778bba61267708458d12268aa5fecc62.zip cpython-c09acfda778bba61267708458d12268aa5fecc62.tar.gz cpython-c09acfda778bba61267708458d12268aa5fecc62.tar.bz2 |
Fix bug in _checkquote that raised an exception on empty "arg".
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/imaplib.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/imaplib.py b/Lib/imaplib.py index 6a74728..f353015 100644 --- a/Lib/imaplib.py +++ b/Lib/imaplib.py @@ -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) |