summaryrefslogtreecommitdiffstats
path: root/Lib/imaplib.py
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2014-02-07 18:51:22 (GMT)
committerR David Murray <rdmurray@bitdance.com>2014-02-07 18:51:22 (GMT)
commitca00c6ea65c47e709c89dc16960b13e4b3e00c56 (patch)
tree26e3cb0eaa2f85557b0d5c500a81ffe4b686a18d /Lib/imaplib.py
parent76249ea4a7ab1cb0fa41d967b2fb8975916cb955 (diff)
downloadcpython-ca00c6ea65c47e709c89dc16960b13e4b3e00c56.zip
cpython-ca00c6ea65c47e709c89dc16960b13e4b3e00c56.tar.gz
cpython-ca00c6ea65c47e709c89dc16960b13e4b3e00c56.tar.bz2
#20013: don't raise socket error when selected mailbox deleted.
I'm checking this in without a test because not much of this code is tested and I don't have time to work up the necessary extensions to the existing test framework. The patch itself was tested by the person who reported the bug.
Diffstat (limited to 'Lib/imaplib.py')
-rw-r--r--Lib/imaplib.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/imaplib.py b/Lib/imaplib.py
index 4586fb3..10ff340 100644
--- a/Lib/imaplib.py
+++ b/Lib/imaplib.py
@@ -1002,6 +1002,11 @@ class IMAP4:
del self.tagged_commands[tag]
return result
+ # If we've seen a BYE at this point, the socket will be
+ # closed, so report the BYE now.
+
+ self._check_bye()
+
# Some have reported "unexpected response" exceptions.
# Note that ignoring them here causes loops.
# Instead, send me details of the unexpected response and