[Python-checkins] [2.7] bpo-33023: Fix NotImplemented to NotImplementedError. (GH-10934). (GH-11001) (GH-11008)

Serhiy Storchaka webhook-mailer at python.org
Fri Dec 7 01:02:37 EST 2018


https://github.com/python/cpython/commit/324e1790094708538acf2e7795f9c44e3732aaf7
commit: 324e1790094708538acf2e7795f9c44e3732aaf7
branch: 2.7
author: Serhiy Storchaka <storchaka at gmail.com>
committer: GitHub <noreply at github.com>
date: 2018-12-07T08:02:33+02:00
summary:

[2.7] bpo-33023: Fix NotImplemented to NotImplementedError. (GH-10934). (GH-11001) (GH-11008)

(cherry picked from commit 42b1d6127bd8595522a78a75166ebb9fba74a6a2)
(cherry picked from commit 7a2cf1e7d3bf300e98c702589d405734f4a8fcf8)

files:
M Lib/ssl.py
M Lib/test/test_ssl.py

diff --git a/Lib/ssl.py b/Lib/ssl.py
index 22d478b56871..087faf95ad99 100644
--- a/Lib/ssl.py
+++ b/Lib/ssl.py
@@ -630,8 +630,8 @@ def context(self, ctx):
         self._sslobj.context = ctx
 
     def dup(self):
-        raise NotImplemented("Can't dup() %s instances" %
-                             self.__class__.__name__)
+        raise NotImplementedError("Can't dup() %s instances" %
+                                  self.__class__.__name__)
 
     def _checkClosed(self, msg=None):
         # raise an exception here if you wish to check for spurious closes
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index dc14e22ad121..e47603170253 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -341,6 +341,7 @@ def test_wrapped_unconnected(self):
             self.assertRaises(socket.error, ss.recvfrom_into, bytearray(b'x'), 1)
             self.assertRaises(socket.error, ss.send, b'x')
             self.assertRaises(socket.error, ss.sendto, b'x', ('0.0.0.0', 0))
+            self.assertRaises(NotImplementedError, ss.dup)
 
     def test_timeout(self):
         # Issue #8524: when creating an SSL socket, the timeout of the
@@ -2645,6 +2646,7 @@ def _recvfrom_into():
                 self.assertEqual(s.read(-1, buffer), len(data))
                 self.assertEqual(buffer, data)
 
+                self.assertRaises(NotImplementedError, s.dup)
                 s.write(b"over\n")
 
                 self.assertRaises(ValueError, s.recv, -1)



More information about the Python-checkins mailing list