-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
gh-122255: Synchronize warnings in C and Python implementations of the warnings module #122824
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-122255: Synchronize warnings in C and Python implementations of the warnings module #122824
Conversation
… of the warnings module In the linecache module and in the Python implementation of the warnings module, a DeprecationWarning is issued when m.__loader__ differs from m.__spec__.loader (like in the C implementation of the warnings module).
Misc/NEWS.d/next/Library/2024-08-08-12-39-36.gh-issue-122255.J_gU8Y.rst
Outdated
Show resolved
Hide resolved
|
Failed tests show that we may reconsider this deprecation. |
vstinner
left a comment
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.
LGTM. I just left minor comments.
| DeprecationWarning) | ||
| return loader | ||
|
|
||
| assert spec_loader is not None |
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.
This assertion looks redundant.
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.
There is such assertion in _bless_my_loader() in Lib/importlib/_bootstrap_external.py. This function is its copy with minimal necessary changes.
Co-authored-by: Victor Stinner <[email protected]>
… of the warnings module (pythonGH-122824) In the linecache module and in the Python implementation of the warnings module, a DeprecationWarning is issued when m.__loader__ differs from m.__spec__.loader (like in the C implementation of the warnings module).
In the linecache module and in the Python implementation of the warnings module, a DeprecationWarning is issued when
m.__loader__differs fromm.__spec__.loader(like in the C implementation of the warnings module).