Added exception string when msg can't be converted to string

This commit is contained in:
veera venky
2019-02-10 16:43:21 +05:30
parent b5911ed796
commit 9bc9befee6

View File

@@ -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");