Function
check_env_var_len
(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] |
Tested by
no test coverage detected