mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-09 22:49:57 +09:00
Added exception string when msg can't be converted to string
This commit is contained in:
@@ -73,7 +73,7 @@ fn exception_str(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
|
||||
let msg = if let Some(m) = exc.get_attr("msg") {
|
||||
match vm.to_pystr(&m) {
|
||||
Ok(msg) => msg,
|
||||
_ => "".to_string(),
|
||||
_ => "<exception str() failed>".to_string(),
|
||||
}
|
||||
} else {
|
||||
panic!("Error message must be set");
|
||||
|
||||
Reference in New Issue
Block a user