-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Multi phase module init #6740
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
base: main
Are you sure you want to change the base?
Multi phase module init #6740
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
405fcba to
b830498
Compare
b830498 to
b97576a
Compare
- Use PyModule::__init_dict_from_def() instead of manually creating dict as attribute, fixing module dict initialization - Revert gc.get_referents/get_referrers to NotImplementedError Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
660f2fb to
054b125
Compare
|
Code has been automatically formatted The code in this PR has been formatted using:
git pull origin multi-phase-module-init |
7ce8228 to
338374a
Compare
338374a to
5b2598b
Compare
- Restore compile.rs to upstream/main to fix finally block not executing properly in return/break/continue paths. The previous changes to fblock handler clearing were incorrect and caused finally blocks to be skipped. - Remove expectedFailure decorators from test_builtin_functions in test_pickle.py and test_pickletools.py as these tests now pass. - Clean up duplicate test methods in PyPicklerTests class. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
| use crate::vm::{PyRef, VirtualMachine, builtins::PyModule}; | ||
|
|
||
| pub(crate) fn make_module(vm: &VirtualMachine) -> PyRef<PyModule> { | ||
| let _ = vm.import("_hashlib", 0); |
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 line must not be removed
crates/vm/src/macros.rs
Outdated
| @@ -1,5 +1,5 @@ | |||
| #[macro_export] | |||
| macro_rules! extend_module { | |||
| macro_rules! module_exec { | |||
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 is wrong renaming. extend_module is correct here
| use crate::vm::{PyRef, VirtualMachine, builtins::PyModule}; | ||
|
|
||
| pub(crate) fn make_module(vm: &VirtualMachine) -> PyRef<PyModule> { | ||
| let _ = vm.import("_hashlib", 0); |
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 line must not be removed
| #[pymodule(with(cert::ssl_cert, ssl_error::ssl_error, ossl101, ossl111, windows))] | ||
| mod _ssl { | ||
| #[cfg(openssl_vendored)] | ||
| use super::PROBE; |
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.
does PROBE still need to defined on super?
- Restore extend_module macro name (was incorrectly renamed to module_exec) - Restore sha256/sha512 make_module wrappers that import _hashlib first - Move sha256/sha512 back to single-phase init (get_module_inits) - Add call to add_native_modules for single-phase init modules Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
No description provided.