bpo-26543: Fix IMAP4.noop when debug mode is enabled (GH-15206)

This commit is contained in:
Sanyam Khurana 2020-06-02 06:47:45 +05:30 committed by GitHub
parent fe5dd78182
commit 8a3d2af997
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 7 deletions

View file

@ -1251,13 +1251,12 @@ class IMAP4:
sys.stderr.write(' %s.%02d %s\n' % (tm, (secs*100)%100, s))
sys.stderr.flush()
def _dump_ur(self, dict):
# Dump untagged responses (in `dict').
l = dict.items()
if not l: return
t = '\n\t\t'
l = map(lambda x:'%s: "%s"' % (x[0], x[1][0] and '" "'.join(x[1]) or ''), l)
self._mesg('untagged responses dump:%s%s' % (t, t.join(l)))
def _dump_ur(self, untagged_resp_dict):
if not untagged_resp_dict:
return
items = (f'{key}: {value!r}'
for key, value in untagged_resp_dict.items())
self._mesg('untagged responses dump:' + '\n\t\t'.join(items))
def _log(self, line):
# Keep log of last `_cmd_log_len' interactions for debugging.