From: Menno Smits Date: Tue, 30 Dec 2014 09:30:50 +0000 (+1300) Subject: Clean up _quote slightly X-Git-Tag: 0.12^2~15^2~1 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=21f4560b971c422aa37a9569a25d7dc04d4a1eff;p=imapclient.git Clean up _quote slightly --- 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