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

Method new_no_attribute_error

crates/vm/src/vm/vm_new.rs:179–191  ·  view source on GitHub ↗
(&self, obj: PyObjectRef, name: PyStrRef)

Source from the content-addressed store, hash-verified

177 }
178
179 pub fn new_no_attribute_error(&self, obj: PyObjectRef, name: PyStrRef) -> PyBaseExceptionRef {
180 let msg = format!(
181 "'{}' object has no attribute '{}'",
182 obj.class().name(),
183 name
184 );
185 let attribute_error = self.new_attribute_error(msg);
186
187 // Use existing set_attribute_error_context function
188 self.set_attribute_error_context(&attribute_error, obj, name);
189
190 attribute_error
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();

Callers 4

generic_setattrMethod · 0.80
generic_getattrMethod · 0.80
get_slot_from_objectFunction · 0.80
getMethod · 0.80

Calls 1

Tested by

no test coverage detected