forked from RustPython/RustPython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfrozen.rs
More file actions
25 lines (22 loc) · 720 Bytes
/
frozen.rs
File metadata and controls
25 lines (22 loc) · 720 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use crate::bytecode::FrozenModule;
use std::collections::HashMap;
pub fn get_module_inits() -> HashMap<String, FrozenModule> {
let mut modules = HashMap::new();
modules.extend(py_compile_bytecode!(
source = "initialized = True; print(\"Hello world!\")\n",
module_name = "__hello__",
));
modules.extend(py_compile_bytecode!(
file = "Lib/_bootstrap.py",
module_name = "_frozen_importlib",
));
modules.extend(py_compile_bytecode!(
file = "Lib/_bootstrap_external.py",
module_name = "_frozen_importlib_external",
));
#[cfg(feature = "freeze-stdlib")]
{
modules.extend(py_compile_bytecode!(dir = "../Lib/",));
}
modules
}