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

Method validate_errors

crates/vm/src/stdlib/_io.rs:2825–2833  ·  view source on GitHub ↗
(errors: &PyRef<PyUtf8Str>, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

2823 }
2824
2825 fn validate_errors(errors: &PyRef<PyUtf8Str>, vm: &VirtualMachine) -> PyResult<()> {
2826 if errors.as_str().contains('\0') {
2827 return Err(cstring_error(vm));
2828 }
2829 vm.state
2830 .codec_registry
2831 .lookup_error(errors.as_str(), vm)
2832 .map(drop)
2833 }
2834
2835 fn bool_from_index(value: PyObjectRef, vm: &VirtualMachine) -> PyResult<bool> {
2836 let int = value.try_index(vm)?;

Callers

nothing calls this directly

Calls 6

cstring_errorFunction · 0.85
lookup_errorMethod · 0.80
ErrClass · 0.50
containsMethod · 0.45
as_strMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected