Skip to content

Commit 12b961f

Browse files
committed
Fix bug where [::0] did not throw ValueError
1 parent 7858fb8 commit 12b961f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

vm/src/obj/objrange.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ impl PyRange {
363363
};
364364

365365
let new_step = if let Some(int) = slice.step_index(vm)? {
366-
if step.is_zero() {
366+
if int.is_zero() {
367367
return Err(vm.new_value_error("slice step cannot be zero".to_string()));
368368
} else {
369369
PyInt::new(int * self.step.as_bigint()).into_ref(vm)

0 commit comments

Comments
 (0)