diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2018-12-06 20:36:55 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-06 20:36:55 (GMT) |
commit | 42b1d6127bd8595522a78a75166ebb9fba74a6a2 (patch) | |
tree | f6ea667c159c1666d08ad9e81621bdca6f373637 | |
parent | 20428527a7c188d988d20b267cfef58da10b0fc9 (diff) | |
download | cpython-42b1d6127bd8595522a78a75166ebb9fba74a6a2.zip cpython-42b1d6127bd8595522a78a75166ebb9fba74a6a2.tar.gz cpython-42b1d6127bd8595522a78a75166ebb9fba74a6a2.tar.bz2 |
bpo-33023: Fix NotImplemented to NotImplementedError. (GH-10934)
-rw-r--r-- | Lib/idlelib/debugger_r.py | 2 | ||||
-rw-r--r-- | Lib/ssl.py | 4 | ||||
-rw-r--r-- | Lib/test/test_ssl.py | 7 |
3 files changed, 9 insertions, 4 deletions
diff --git a/Lib/idlelib/debugger_r.py b/Lib/idlelib/debugger_r.py index 01a3bd2..0e6dcfb 100644 --- a/Lib/idlelib/debugger_r.py +++ b/Lib/idlelib/debugger_r.py @@ -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() @@ -884,8 +884,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 diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 74a91f6..7f6b931 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -463,8 +463,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 @@ -3382,10 +3386,11 @@ class ThreadedTests(unittest.TestCase): # 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) |