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

bpo-35429: Use raise NotImplementedError instead of NotImplemented by rth · Pull Request #10999 · python/cpython · GitHub

Repository navigation

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

Filter by extension

Filter by extension .py  (4) 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
2 changes: 1 addition & 1 deletion Lib/idlelib/debugger_r.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 @@ -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
6 changes: 6 additions & 0 deletions Lib/idlelib/idle_test/test_debugger_r.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 @@ -21,6 +21,12 @@ class Test(unittest.TestCase):
def test_init(self):
self.assertTrue(True) # Get coverage of import

def test_idbadapter_dict_keys(self):
adapter = debugger_r.IdbAdapter(None)

with self.assertRaises(NotImplementedError):
adapter.dict_keys(None)


# Classes GUIProxy, IdbAdapter, FrameProxy, CodeProxy, DictProxy,
# GUIAdapter, IdbProxy plus 7 module functions.
Expand Down
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 @@ -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
Expand Down
4 changes: 4 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 @@ -3531,6 +3531,10 @@ def serve():
server.close()
# Sanity checks.
self.assertIsInstance(remote, ssl.SSLSocket)

with self.assertRaises(NotImplementedError):
remote.dup()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Maybe this is not the best place to put this check, but it's not obvious to construct the ssl.SSLSocket instance manually, and there is no other place in this test file where we are sure to have such instance.


self.assertEqual(peer, client_addr)

def test_getpeercert_enotconn(self):
Expand Down

Back | FazBrowse Home | New Git URL