Issue #16647: save socket error details in LMTP.connect()
Initial patch by Serhiy Storchaka.
diff --git a/Lib/test/test_smtplib.py b/Lib/test/test_smtplib.py
index befc49e..6fe2df9 100644
--- a/Lib/test/test_smtplib.py
+++ b/Lib/test/test_smtplib.py
@@ -542,9 +542,9 @@
def testNonnumericPort(self):
# check that non-numeric port raises socket.error
- self.assertRaises(mock_socket.error, smtplib.SMTP,
+ self.assertRaises(OSError, smtplib.SMTP,
"localhost", "bogus")
- self.assertRaises(mock_socket.error, smtplib.SMTP,
+ self.assertRaises(OSError, smtplib.SMTP,
"localhost:bogus")