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

Method resolve

crates/vm/src/codecs.rs:882–897  ·  view source on GitHub ↗
(&self, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

880 }
881 #[inline]
882 fn resolve(&self, vm: &VirtualMachine) -> PyResult<&ResolvedError> {
883 if let Some(val) = self.resolved.get() {
884 return Ok(val);
885 }
886 let errors_str = self.errors.as_str();
887 let val = if let Ok(standard) = errors_str.parse() {
888 ResolvedError::Standard(standard)
889 } else {
890 vm.state
891 .codec_registry
892 .lookup_error(errors_str, vm)
893 .map(ResolvedError::Handler)?
894 };
895 let _ = self.resolved.set(val);
896 Ok(self.resolved.get().unwrap())
897 }
898}
899impl StrBuffer for PyStrRef {
900 fn is_compatible_with(&self, kind: StrKind) -> bool {

Callers 2

handle_encode_errorMethod · 0.45
handle_decode_errorMethod · 0.45

Calls 7

lookup_errorMethod · 0.80
getMethod · 0.45
as_strMethod · 0.45
parseMethod · 0.45
mapMethod · 0.45
setMethod · 0.45
unwrapMethod · 0.45

Tested by

no test coverage detected