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

Method new_name_error

crates/vm/src/vm/vm_new.rs:193–198  ·  view source on GitHub ↗
(&self, msg: impl Into<Wtf8Buf>, name: PyStrRef)

Source from the content-addressed store, hash-verified

191 }
192
193 pub fn new_name_error(&self, msg: impl Into<Wtf8Buf>, name: PyStrRef) -> PyBaseExceptionRef {
194 let name_error_type = self.ctx.exceptions.name_error.to_owned();
195 let name_error = self.new_exception_msg(name_error_type, msg.into());
196 name_error.as_object().set_attr("name", name, self).unwrap();
197 name_error
198 }
199
200 pub fn new_unsupported_unary_error(&self, a: &PyObject, op: &str) -> PyBaseExceptionRef {
201 self.new_type_error(format!(

Callers 4

name_errorMethod · 0.80
execute_instructionMethod · 0.80

Calls 5

new_exception_msgMethod · 0.80
to_ownedMethod · 0.45
unwrapMethod · 0.45
set_attrMethod · 0.45
as_objectMethod · 0.45

Tested by

no test coverage detected