Issue #16717: get rid of socket.error, replace with OSError
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 @@
         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 @@
         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