-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-128772: Fix - warnings.deprecated doesn't work well with pydoc #128781
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new test for the change to the warnings module belongs in test.test_warnings.
Revert this change to the idlelib file. This idle test is strictly for testing that idle reverts its monkeypatching of warnings before it exits.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
This probably should have a blurb and whoever merges may require one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to use exec()
? Can the tests simply use local classes as other deprecated()
tests? Is it necessary to create an instance of the deprecated class?
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since test_warnings
already has been converted to a package, and there is a subpackage data
, it can be easy to add a file with deprecated classes.
I can reproduce the original issue without creating an instance of the class.
Alternatively, this can be fixed in pydoc, by accounting for methods without a class A:
def __new__(cls): pass
A.__new__.__module__ = None
# pydoc on A fails
|
… module and simplify the test that removes the need for exec function
@serhiy-storchaka Done. Pls review again |
You are right. This is a more correct way to fix this issue. See #129177. |
@serhiy-storchaka Nice. Can we close this PR? |
warnings.deprecated
doesn't work well withpydoc
#128772