diff options
author | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-12-18 21:10:48 (GMT) |
---|---|---|
committer | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-12-18 21:10:48 (GMT) |
commit | 0832af6628ca5ac02d0226899725297dd508470b (patch) | |
tree | fc4e7d05d9c6f51eb97f3e8abbcab2b226330b94 /Lib/imaplib.py | |
parent | ad28c7f9dad791567afa0624acfb3ba430851965 (diff) | |
download | cpython-0832af6628ca5ac02d0226899725297dd508470b.zip cpython-0832af6628ca5ac02d0226899725297dd508470b.tar.gz cpython-0832af6628ca5ac02d0226899725297dd508470b.tar.bz2 |
Issue #16717: get rid of socket.error, replace with OSError
Diffstat (limited to 'Lib/imaplib.py')
-rw-r--r-- | Lib/imaplib.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/imaplib.py b/Lib/imaplib.py index 3f8c65a..fba3bca 100644 --- a/Lib/imaplib.py +++ b/Lib/imaplib.py @@ -174,7 +174,7 @@ class IMAP4: except Exception: try: self.shutdown() - except socket.error: + except OSError: pass raise @@ -267,7 +267,7 @@ class IMAP4: self.file.close() try: self.sock.shutdown(socket.SHUT_RDWR) - except socket.error as e: + except OSError as e: # The server might already have closed the connection if e.errno != errno.ENOTCONN: raise @@ -899,7 +899,7 @@ class IMAP4: try: self.send(data + CRLF) - except (socket.error, OSError) as val: + except OSError as val: raise self.abort('socket error: %s' % val) if literal is None: @@ -924,7 +924,7 @@ class IMAP4: try: self.send(literal) self.send(CRLF) - except (socket.error, OSError) as val: + except OSError as val: raise self.abort('socket error: %s' % val) if not literator: |