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

Function backslashreplace_errors

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

Source from the content-addressed store, hash-verified

1189}
1190
1191fn backslashreplace_errors(
1192 err: PyObjectRef,
1193 vm: &VirtualMachine,
1194) -> PyResult<(PyObjectRef, usize)> {
1195 if is_decode_err(&err, vm) {
1196 call_native_decode_error(errors::BackslashReplace, err, vm)
1197 } else if is_encode_err(&err, vm) {
1198 call_native_encode_error(errors::BackslashReplace, err, vm)
1199 } else if is_translate_err(&err, vm) {
1200 call_native_translate_error(errors::BackslashReplace, err, vm)
1201 } else {
1202 Err(bad_err_type(err, vm))
1203 }
1204}
1205
1206fn namereplace_errors(err: PyObjectRef, vm: &VirtualMachine) -> PyResult<(PyObjectRef, usize)> {
1207 if is_encode_err(&err, vm) {

Callers

nothing calls this directly

Calls 8

is_decode_errFunction · 0.85
call_native_decode_errorFunction · 0.85
is_encode_errFunction · 0.85
call_native_encode_errorFunction · 0.85
is_translate_errFunction · 0.85
bad_err_typeFunction · 0.85
ErrClass · 0.50

Tested by

no test coverage detected