Skip to content

Commit f241afa

Browse files
committed
Fix Issue9638 - remove dead code from py3k imaplib
1 parent e8d5145 commit f241afa

1 file changed

Lines changed: 0 additions & 15 deletions

File tree

Lib/imaplib.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,6 @@ class error(Exception): pass # Logical errors - debug required
147147
class abort(error): pass # Service errors - close and retry
148148
class readonly(abort): pass # Mailbox status changed to READ-ONLY
149149

150-
mustquote = re.compile(br"[^\w!#$%&'*+,.:;<=>?^`|~-]", re.ASCII)
151-
152150
def __init__(self, host = '', port = IMAP4_PORT):
153151
self.debug = Debug
154152
self.state = 'LOGOUT'
@@ -846,7 +844,6 @@ def _command(self, name, *args):
846844
if arg is None: continue
847845
if isinstance(arg, str):
848846
arg = bytes(arg, "ASCII")
849-
#data = data + b' ' + self._checkquote(arg)
850847
data = data + b' ' + arg
851848

852849
literal = self.literal
@@ -1055,18 +1052,6 @@ def _new_tag(self):
10551052
return tag
10561053

10571054

1058-
def _checkquote(self, arg):
1059-
1060-
# Must quote command args if non-alphanumeric chars present,
1061-
# and not already quoted.
1062-
1063-
if len(arg) >= 2 and (arg[0],arg[-1]) in (('(',')'),('"','"')):
1064-
return arg
1065-
if arg and self.mustquote.search(arg) is None:
1066-
return arg
1067-
return self._quote(arg)
1068-
1069-
10701055
def _quote(self, arg):
10711056

10721057
arg = arg.replace(b'\\', b'\\\\')

0 commit comments

Comments
 (0)