summaryrefslogtreecommitdiffstats
path: root/Lib/imaplib.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/imaplib.py')
-rw-r--r--Lib/imaplib.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/imaplib.py b/Lib/imaplib.py
index 724f9d1..30f51da 100644
--- a/Lib/imaplib.py
+++ b/Lib/imaplib.py
@@ -29,7 +29,7 @@ from io import DEFAULT_BUFFER_SIZE
try:
import ssl
HAVE_SSL = True
-except ImportError:
+except ModuleNotFoundError:
HAVE_SSL = False
__all__ = ["IMAP4", "IMAP4_stream", "Internaldate2tuple",
@@ -176,7 +176,7 @@ class IMAP4:
except Exception:
try:
self.shutdown()
- except socket.error:
+ except OSError:
pass
raise
@@ -269,7 +269,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
@@ -903,7 +903,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:
@@ -928,7 +928,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: