]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-33023: Fix NotImplemented to NotImplementedError. (GH-10934). (GH-11001)
authorSerhiy Storchaka <storchaka@gmail.com>
Thu, 6 Dec 2018 21:00:39 +0000 (23:00 +0200)
committerGitHub <noreply@github.com>
Thu, 6 Dec 2018 21:00:39 +0000 (23:00 +0200)
(cherry picked from commit 42b1d6127bd8595522a78a75166ebb9fba74a6a2)

Lib/idlelib/debugger_r.py
Lib/ssl.py
Lib/test/test_ssl.py

index 01a3bd25998fc04ba1bc4acc7814f5b9d0fbf142..0e6dcfbd12c2ab781abe4810b548b9cd9f2cd8d9 100644 (file)
@@ -157,7 +157,7 @@ class IdbAdapter:
     #----------called by a DictProxy----------
 
     def dict_keys(self, did):
-        raise NotImplemented("dict_keys not public or pickleable")
+        raise NotImplementedError("dict_keys not public or pickleable")
 ##         dict = dicttable[did]
 ##         return dict.keys()
 
index cd216a15cda8361bebc473c4e8a2db341cc60873..58d3e939226b37d48d211a5585ff83b8132162aa 100644 (file)
@@ -848,8 +848,8 @@ class SSLSocket(socket):
             return self._sslobj.session_reused
 
     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
index 2f0b6a75e96f19808175dbdcde1e4ba664d8e582..705f1d3245b6775892c2959197e3ab568d904fda 100644 (file)
@@ -408,6 +408,12 @@ class BasicSocketTests(unittest.TestCase):
             self.assertRaises(OSError, ss.recvfrom_into, bytearray(b'x'), 1)
             self.assertRaises(OSError, ss.send, b'x')
             self.assertRaises(OSError, ss.sendto, b'x', ('0.0.0.0', 0))
+            self.assertRaises(NotImplementedError, ss.dup)
+            self.assertRaises(NotImplementedError, ss.sendmsg,
+                              [b'x'], (), 0, ('0.0.0.0', 0))
+            self.assertRaises(NotImplementedError, ss.recvmsg, 100)
+            self.assertRaises(NotImplementedError, ss.recvmsg_into,
+                              [bytearray(100)])
 
     def test_timeout(self):
         # Issue #8524: when creating an SSL socket, the timeout of the
@@ -2942,11 +2948,11 @@ if _have_threads:
                 # Make sure sendmsg et al are disallowed to avoid
                 # inadvertent disclosure of data and/or corruption
                 # of the encrypted data stream
+                self.assertRaises(NotImplementedError, s.dup)
                 self.assertRaises(NotImplementedError, s.sendmsg, [b"data"])
                 self.assertRaises(NotImplementedError, s.recvmsg, 100)
                 self.assertRaises(NotImplementedError,
-                                  s.recvmsg_into, bytearray(100))
-
+                                  s.recvmsg_into, [bytearray(100)])
                 s.write(b"over\n")
 
                 self.assertRaises(ValueError, s.recv, -1)