FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[2.7] bpo-33023: Fix NotImplemented to NotImplementedError. (GH-10934). (GH-11001) by serhiy-storchaka · Pull Request #11008 · python/cpython · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
4 changes: 2 additions & 2 deletions Lib/ssl.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -630,8 +630,8 @@ def context(self, ctx):
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
Expand Down
2 changes: 2 additions & 0 deletions Lib/test/test_ssl.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ def test_wrapped_unconnected(self):
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
Expand Down Expand Up @@ -2645,6 +2646,7 @@ def _recvfrom_into():
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)
Expand Down

Back | FazBrowse Home | New Git URL