gh-128772: Fix - warnings.deprecated doesn't work well with pydoc#128781
gh-128772: Fix - warnings.deprecated doesn't work well with pydoc#128781srinivasreddy wants to merge 25 commits intopython:mainfrom
Conversation
terryjreedy
left a comment
There was a problem hiding this comment.
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. |
serhiy-storchaka
left a comment
There was a problem hiding this comment.
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?
|
serhiy-storchaka
left a comment
There was a problem hiding this comment.
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.deprecateddoesn't work well withpydoc#128772