summaryrefslogtreecommitdiff
path: root/Lib/imaplib.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/imaplib.py')
-rw-r--r--Lib/imaplib.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/imaplib.py b/Lib/imaplib.py
index 6a747285b9..f353015c93 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)