MCPcopy Index your code
hub / github.com/RustPython/RustPython / module_exec

Function module_exec

crates/vm/src/stdlib/_io.rs:5301–5319  ·  view source on GitHub ↗
(vm: &VirtualMachine, module: &Py<PyModule>)

Source from the content-addressed store, hash-verified

5299 }
5300
5301 pub(crate) fn module_exec(vm: &VirtualMachine, module: &Py<PyModule>) -> PyResult<()> {
5302 // Call auto-generated initialization first
5303 __module_exec(vm, module);
5304
5305 // Initialize FileIO types (requires host_env for filesystem access)
5306 #[cfg(feature = "host_env")]
5307 super::fileio::module_exec(vm, module)?;
5308
5309 // Initialize WindowsConsoleIO type (Windows only)
5310 #[cfg(all(feature = "host_env", windows))]
5311 super::winconsoleio::module_exec(vm, module)?;
5312
5313 let unsupported_operation = unsupported_operation().to_owned();
5314 extend_module!(vm, module, {
5315 "UnsupportedOperation" => unsupported_operation,
5316 "BlockingIOError" => vm.ctx.exceptions.blocking_io_error.to_owned(),
5317 });
5318 Ok(())
5319 }
5320}
5321// FileIO requires host environment for filesystem access
5322#[cfg(feature = "host_env")]

Callers

nothing calls this directly

Calls 2

unsupported_operationFunction · 0.85
to_ownedMethod · 0.45

Tested by

no test coverage detected