From 324e1790094708538acf2e7795f9c44e3732aaf7 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Fri, 7 Dec 2018 08:02:33 +0200 Subject: [2.7] bpo-33023: Fix NotImplemented to NotImplementedError. (GH-10934). (GH-11001) (GH-11008) (cherry picked from commit 42b1d6127bd8595522a78a75166ebb9fba74a6a2) (cherry picked from commit 7a2cf1e7d3bf300e98c702589d405734f4a8fcf8) --- Lib/ssl.py | 4 ++-- Lib/test/test_ssl.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Lib/ssl.py b/Lib/ssl.py index 22d478b568..087faf95ad 100644 --- a/Lib/ssl.py +++ b/Lib/ssl.py @@ -630,8 +630,8 @@ class SSLSocket(socket): 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 dc14e22ad1..e476031702 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -341,6 +341,7 @@ class BasicSocketTests(unittest.TestCase): 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 @@ else: 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) -- cgit v1.2.1