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

Function py_decode_error

crates/stdlib/src/json.rs:681–694  ·  view source on GitHub ↗
(
        e: machinery::DecodeError,
        s: PyStrRef,
        vm: &VirtualMachine,
    )

Source from the content-addressed store, hash-verified

679 }
680
681 fn py_decode_error(
682 e: machinery::DecodeError,
683 s: PyStrRef,
684 vm: &VirtualMachine,
685 ) -> PyBaseExceptionRef {
686 let get_error = || -> PyResult<_> {
687 let cls = vm.try_class("json", "JSONDecodeError")?;
688 let exc = PyType::call(&cls, (e.msg, s, e.pos).into_args(vm), vm)?;
689 exc.try_into_value(vm)
690 };
691 match get_error() {
692 Ok(x) | Err(x) => x,
693 }
694 }
695
696 #[pyfunction]
697 fn scanstring(

Callers 5

parseMethod · 0.85
parse_objectMethod · 0.85
call_scan_onceMethod · 0.85
make_decode_errorMethod · 0.85
scanstringFunction · 0.85

Calls 4

try_classMethod · 0.80
try_into_valueMethod · 0.80
callFunction · 0.50
into_argsMethod · 0.45

Tested by

no test coverage detected