mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
simplify exception_repr a bit
This commit is contained in:
1 parent
82101d9f1a
commit
060cd75783
1 file changed
-1
@@ -185,7 +185,6 @@ fn exception_repr(vm: &VirtualMachine, args: PyFuncArgs) -> PyResult {
|
||||
let exc_name = exc.class().name.clone();
|
||||
let joined_str = match args_repr.len() {
|
||||
0 => format!("{}()", exc_name),
|
||||
1 => format!("{}({})", exc_name, args_repr[0].to_string()),
|
||||
_ => format!("{}({})", exc_name, args_repr.join(", ")),
|
||||
};
|
||||
Ok(vm.new_str(joined_str))
|
||||
|
||||
Reference in new issue
Block a user