diff --git a/vm/src/obj/objstr.rs b/vm/src/obj/objstr.rs index ff609eaad..662438717 100644 --- a/vm/src/obj/objstr.rs +++ b/vm/src/obj/objstr.rs @@ -514,7 +514,7 @@ impl PyString { fn modulo(&self, values: PyObjectRef, vm: &VirtualMachine) -> PyResult { let format_string_text = &self.value; let format_string = CFormatString::from_str(format_string_text) - .map_err(|err| vm.new_value_error(format!("{}", err)))?; + .map_err(|err| vm.new_value_error(err.to_string()))?; do_cformat(vm, format_string, values.clone()) }