(
e: machinery::DecodeError,
s: PyStrRef,
vm: &VirtualMachine,
)
| 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( |
no test coverage detected