forked from RustPython/RustPython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_sysconfig.rs
More file actions
24 lines (19 loc) · 833 Bytes
/
_sysconfig.rs
File metadata and controls
24 lines (19 loc) · 833 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
pub(crate) use _sysconfig::module_def;
#[pymodule]
pub(crate) mod _sysconfig {
use crate::{VirtualMachine, builtins::PyDictRef, convert::ToPyObject};
#[pyfunction]
fn config_vars(vm: &VirtualMachine) -> PyDictRef {
let vars = vm.ctx.new_dict();
// FIXME: This is an entirely wrong implementation of EXT_SUFFIX.
// EXT_SUFFIX must be a string starting with "." for pip compatibility
// Using ".pyd" causes pip's _generic_abi() to fall back to _cpython_abis()
vars.set_item("EXT_SUFFIX", ".pyd".to_pyobject(vm), vm)
.unwrap();
vars.set_item("SOABI", vm.ctx.none(), vm).unwrap();
vars.set_item("Py_GIL_DISABLED", (1).to_pyobject(vm), vm)
.unwrap();
vars.set_item("Py_DEBUG", (0).to_pyobject(vm), vm).unwrap();
vars
}
}