Skip to content

Commit

Permalink
bpo-33023: Fix NotImplemented to NotImplementedError. (GH-10934). (GH…
Browse files Browse the repository at this point in the history
…-11001)

(cherry picked from commit 42b1d61)
  • Loading branch information
serhiy-storchaka committed Dec 6, 2018
1 parent 3f0e8e2 commit 7a2cf1e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Lib/idlelib/debugger_r.py
Expand Up @@ -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()

Expand Down
4 changes: 2 additions & 2 deletions Lib/ssl.py
Expand Up @@ -848,8 +848,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
Expand Down
10 changes: 8 additions & 2 deletions Lib/test/test_ssl.py
Expand Up @@ -408,6 +408,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
Expand Down Expand Up @@ -2942,11 +2948,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)
Expand Down

0 comments on commit 7a2cf1e

Please sign in to comment.