From 21f4560b971c422aa37a9569a25d7dc04d4a1eff Mon Sep 17 00:00:00 2001 From: Menno Smits Date: Tue, 30 Dec 2014 22:30:50 +1300 Subject: [PATCH] Clean up _quote slightly --- imapclient/imapclient.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/imapclient/imapclient.py b/imapclient/imapclient.py index 8928d14..e5b6739 100644 --- a/imapclient/imapclient.py +++ b/imapclient/imapclient.py @@ -982,16 +982,16 @@ class IMAPClient(object): folder_name = encode_utf7(folder_name) return _quote(folder_name) -#XXX revisit def _quote(arg): if isinstance(arg, text_type): arg = arg.replace('\\', '\\\\') arg = arg.replace('"', '\\"') - return '"%s"' % arg + q = '"' else: arg = arg.replace(b'\\', b'\\\\') arg = arg.replace(b'"', b'\\"') - return b'"' + arg + b'"' + q = b'"' + return q + arg + q # normalise_text_list, seq_to_parentstr etc have to return unicode # because imaplib handles flags and sort criteria assuming these are -- 2.43.0