File tree Expand file tree Collapse file tree 2 files changed +18
-11
lines changed
Expand file tree Collapse file tree 2 files changed +18
-11
lines changed Original file line number Diff line number Diff line change 11fn main ( ) {
2- process_python_libs ( "../Lib/python_builtins/*" ) ;
2+ process_python_libs ( "../vm/ Lib/python_builtins/*" ) ;
33
44 #[ cfg( not( feature = "stdlib" ) ) ]
5- process_python_libs ( "../Lib/core_modules/*" ) ;
6-
7- #[ cfg( feature = "stdlib" ) ]
8- process_python_libs ( "../../Lib/**/*" ) ;
5+ process_python_libs ( "../vm/Lib/core_modules/*" ) ;
6+ #[ cfg( feature = "freeze-stdlib" ) ]
7+ if cfg ! ( windows) {
8+ process_python_libs ( "../Lib/**/*" ) ;
9+ } else {
10+ process_python_libs ( "./Lib/**/*" ) ;
11+ }
912
1013 if cfg ! ( windows) {
1114 if let Ok ( real_path) = std:: fs:: read_to_string ( "Lib" ) {
Original file line number Diff line number Diff line change @@ -244,11 +244,13 @@ impl VirtualMachine {
244244
245245 fn import_utf8_encodings ( & mut self ) -> PyResult < ( ) > {
246246 import:: import_frozen ( self , "codecs" ) ?;
247- let encoding_module_name = if cfg ! ( feature = "freeze-stdlib" ) {
248- "encodings.utf_8"
249- } else {
250- "encodings_utf_8"
251- } ;
247+ // FIXME: See corresponding part of `core_frozen_inits`
248+ // let encoding_module_name = if cfg!(feature = "freeze-stdlib") {
249+ // "encodings.utf_8"
250+ // } else {
251+ // "encodings_utf_8"
252+ // };
253+ let encoding_module_name = "encodings_utf_8" ;
252254 let encoding_module = import:: import_frozen ( self , encoding_module_name) ?;
253255 let getregentry = encoding_module. get_attr ( "getregentry" , self ) ?;
254256 let codec_info = getregentry. call ( ( ) , self ) ?;
@@ -875,7 +877,9 @@ fn core_frozen_inits() -> impl Iterator<Item = (&'static str, FrozenModule)> {
875877
876878 // core stdlib Python modules that the vm calls into, but are still used in Python
877879 // application code, e.g. copyreg
878- #[ cfg( not( feature = "freeze-stdlib" ) ) ]
880+ // FIXME: Initializing core_modules here results duplicated frozen module generation for core_modules.
881+ // We need a way to initialize this modules for both `Interpreter::without_stdlib()` and `InterpreterConfig::new().init_stdlib().interpreter()`
882+ // #[cfg(not(feature = "freeze-stdlib"))]
879883 ext_modules ! (
880884 iter,
881885 dir = "./Lib/core_modules" ,
You can’t perform that action at this time.
0 commit comments