Skip to content

Commit 6d3960b

Browse files
committed
follow CPython error message
1 parent 3e8e22b commit 6d3960b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vm/src/builtins/float.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ fn inner_divmod(v1: f64, v2: f64, vm: &VirtualMachine) -> PyResult<(f64, f64)> {
124124

125125
pub fn float_pow(v1: f64, v2: f64, vm: &VirtualMachine) -> PyResult {
126126
if v1.is_zero() && v2.is_sign_negative() {
127-
let msg = format!("{v1:?} cannot be raised to a negative power");
128-
Err(vm.new_zero_division_error(msg))
127+
let msg = "0.0 cannot be raised to a negative power";
128+
Err(vm.new_zero_division_error(msg.to_owned()))
129129
} else if v1.is_sign_negative() && (v2.floor() - v2).abs() > f64::EPSILON {
130130
let v1 = Complex64::new(v1, 0.);
131131
let v2 = Complex64::new(v2, 0.);

0 commit comments

Comments
 (0)