mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-09 22:49:57 +09:00
17 lines
491 B
Rust
17 lines
491 B
Rust
use crate::pyobject::{ItemProtocol, PyObjectRef};
|
|
use crate::VirtualMachine;
|
|
|
|
pub fn make_module(vm: &VirtualMachine) -> PyObjectRef {
|
|
let vars = vm.ctx.new_dict();
|
|
macro_rules! hashmap {
|
|
($($key:literal => $value:literal),*) => {{
|
|
$(vars.set_item($key, vm.ctx.new_str($value.to_owned()), vm).unwrap();)*
|
|
}};
|
|
}
|
|
include!(concat!(env!("OUT_DIR"), "/env_vars.rs"));
|
|
|
|
py_module!(vm, "_sysconfigdata", {
|
|
"build_time_vars" => vars,
|
|
})
|
|
}
|