summaryrefslogtreecommitdiffstats
path: root/Lib/smtpd.py
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2012-12-18 21:10:48 (GMT)
committerAndrew Svetlov <andrew.svetlov@gmail.com>2012-12-18 21:10:48 (GMT)
commit0832af6628ca5ac02d0226899725297dd508470b (patch)
treefc4e7d05d9c6f51eb97f3e8abbcab2b226330b94 /Lib/smtpd.py
parentad28c7f9dad791567afa0624acfb3ba430851965 (diff)
downloadcpython-0832af6628ca5ac02d0226899725297dd508470b.zip
cpython-0832af6628ca5ac02d0226899725297dd508470b.tar.gz
cpython-0832af6628ca5ac02d0226899725297dd508470b.tar.bz2
Issue #16717: get rid of socket.error, replace with OSError
Diffstat (limited to 'Lib/smtpd.py')
-rwxr-xr-xLib/smtpd.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/smtpd.py b/Lib/smtpd.py
index 778d6d6..1e239a1 100755
--- a/Lib/smtpd.py
+++ b/Lib/smtpd.py
@@ -137,7 +137,7 @@ class SMTPChannel(asynchat.async_chat):
self.num_bytes = 0
try:
self.peer = conn.getpeername()
- except socket.error as err:
+ except OSError as err:
# a race condition may occur if the other end is closing
# before we can get the peername
self.close()
@@ -668,7 +668,7 @@ class PureProxy(SMTPServer):
except smtplib.SMTPRecipientsRefused as e:
print('got SMTPRecipientsRefused', file=DEBUGSTREAM)
refused = e.recipients
- except (socket.error, smtplib.SMTPException) as e:
+ except (OSError, smtplib.SMTPException) as e:
print('got', e.__class__, file=DEBUGSTREAM)
# All recipients were refused. If the exception had an associated
# error code, use it. Otherwise,fake it with a non-triggering