[Python-checkins] bpo-33023: Fix NotImplemented to NotImplementedError. (GH-10934)
Miss Islington (bot)
webhook-mailer at python.org
Thu Dec 6 15:52:48 EST 2018
https://github.com/python/cpython/commit/6485aa6eb1024672f08afdd577e2b5792eb6b03c
commit: 6485aa6eb1024672f08afdd577e2b5792eb6b03c
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018-12-06T12:52:43-08:00
summary:
bpo-33023: Fix NotImplemented to NotImplementedError. (GH-10934)
(cherry picked from commit 42b1d6127bd8595522a78a75166ebb9fba74a6a2)
Co-authored-by: Serhiy Storchaka <storchaka at gmail.com>
files:
M Lib/idlelib/debugger_r.py
M Lib/ssl.py
M Lib/test/test_ssl.py
diff --git a/Lib/idlelib/debugger_r.py b/Lib/idlelib/debugger_r.py
index 01a3bd25998f..0e6dcfbd12c2 100644
--- a/Lib/idlelib/debugger_r.py
+++ b/Lib/idlelib/debugger_r.py
@@ -157,7 +157,7 @@ def code_filename(self, cid):
#----------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()
diff --git a/Lib/ssl.py b/Lib/ssl.py
index 38aa38907e15..d1d986682035 100644
--- a/Lib/ssl.py
+++ b/Lib/ssl.py
@@ -884,8 +884,8 @@ def session_reused(self):
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 d4132c5043c7..f1b9565c8d91 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -480,8 +480,12 @@ def test_wrapped_unconnected(self):
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
@@ -3410,10 +3414,11 @@ def _recvfrom_into():
# 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)
More information about the Python-checkins
mailing list