Issue 1776581. Minor corrections to smtplib, and two small tests.
Thanks Alan McIntyre.
diff --git a/Lib/test/test_smtplib.py b/Lib/test/test_smtplib.py
index e2b9b06..933523b 100644
--- a/Lib/test/test_smtplib.py
+++ b/Lib/test/test_smtplib.py
@@ -82,8 +82,9 @@
         # to reference the nonexistent 'sock' attribute of the SMTP object
         # causes an AttributeError)
         smtp = smtplib.SMTP()
-        self.assertRaises(AttributeError, smtp.ehlo)
-        self.assertRaises(AttributeError, smtp.send, 'test msg')
+        self.assertRaises(smtplib.SMTPServerDisconnected, smtp.ehlo)
+        self.assertRaises(smtplib.SMTPServerDisconnected,
+                          smtp.send, 'test msg')
 
     def testLocalHostName(self):
         # check that supplied local_hostname is used