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

Function check_env_var_len

crates/vm/src/stdlib/os.rs:493–501  ·  view source on GitHub ↗
(wide_len: usize, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

491 /// Check if wide string length exceeds Windows environment variable limit.
492 #[cfg(windows)]
493 fn check_env_var_len(wide_len: usize, vm: &VirtualMachine) -> PyResult<()> {
494 use crate::common::windows::_MAX_ENV;
495 if wide_len > _MAX_ENV + 1 {
496 return Err(vm.new_value_error(format!(
497 "the environment variable is longer than {_MAX_ENV} characters",
498 )));
499 }
500 Ok(())
501 }
502
503 #[cfg(windows)]
504 #[pyfunction]

Callers 2

putenvFunction · 0.85
unsetenvFunction · 0.85

Calls 1

ErrClass · 0.50

Tested by

no test coverage detected