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

bpo-35429: Use raise NotImplementedError instead of NotImplemented - #10999

Closed
rth wants to merge 3 commits into
python:masterfrom
rth:not-implemented-error
Closed

rth wants to merge 3 commits into
python:masterfrom
rth:not-implemented-error

Conversation

rth commented Dec 6, 2018 •
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Contributor

Closes https://bugs.python.org/issue35429

In two places in stdlib, raise NotImplemented was used instead of raise NotImplementedError. The former is not valid and produces,

>>> raise NotImplemented('message')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'NotImplementedType' object is not callable

https://bugs.python.org/issue35429

Copy link
Copy Markdown
Contributor

Please add tests to prevent regression.

Comment thread Lib/test/test_ssl.py
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.

rth commented Dec 6, 2018

Copy link
Copy Markdown
Contributor Author

Thanks @rhettinger, added non regression tests..

Copy link
Copy Markdown
Member

This is a duplicate of #10934.

terryjreedy removed their request for review December 7, 2018 06:34
rth deleted the not-implemented-error branch December 7, 2018 07:07
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL