mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-09 22:49:57 +09:00
Fixing assert second argument formatting
This commit is contained in:
@@ -71,7 +71,10 @@ fn exception_str(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
|
||||
);
|
||||
let type_name = objtype::get_type_name(&exc.typ());
|
||||
let msg = if let Some(m) = exc.get_attr("msg") {
|
||||
objstr::get_value(&m)
|
||||
match vm.to_pystr(&m) {
|
||||
Ok(msg) => msg,
|
||||
_ => "".to_string(),
|
||||
}
|
||||
} else {
|
||||
panic!("Error message must be set");
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user