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

Function ignore_errors

crates/vm/src/codecs.rs:1155–1162  ·  view source on GitHub ↗
(err: PyObjectRef, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

1153}
1154
1155fn ignore_errors(err: PyObjectRef, vm: &VirtualMachine) -> PyResult<(PyObjectRef, usize)> {
1156 if is_encode_err(&err, vm) || is_decode_err(&err, vm) || is_translate_err(&err, vm) {
1157 let range = extract_unicode_error_range(&err, vm)?;
1158 Ok((vm.ctx.new_str(ascii!("")).into(), range.end))
1159 } else {
1160 Err(bad_err_type(err, vm))
1161 }
1162}
1163
1164fn replace_errors(err: PyObjectRef, vm: &VirtualMachine) -> PyResult<(PyObjectRef, usize)> {
1165 if is_encode_err(&err, vm) {

Callers

nothing calls this directly

Calls 7

is_encode_errFunction · 0.85
is_decode_errFunction · 0.85
is_translate_errFunction · 0.85
bad_err_typeFunction · 0.85
ErrClass · 0.50
new_strMethod · 0.45

Tested by

no test coverage detected