There was an error while loading. Please reload this page.
1 parent 7586543 commit 9657454Copy full SHA for 9657454
1 file changed
vm/src/builtins/int.rs
@@ -711,7 +711,7 @@ struct IntToByteArgs {
711
712
// Casting function:
713
pub(crate) fn to_int(vm: &VirtualMachine, obj: &PyObjectRef) -> PyResult<BigInt> {
714
- fn try_convert(lit: &[u8], vm: &VirtualMachine) -> PyResult<BigInt> {
+ fn try_convert(lit: &[u8], vm: &VirtualMachine, obj: &PyObjectRef) -> PyResult<BigInt> {
715
let base = 10;
716
match bytes_to_int(lit, base) {
717
Some(i) => Ok(i),
@@ -725,9 +725,9 @@ pub(crate) fn to_int(vm: &VirtualMachine, obj: &PyObjectRef) -> PyResult<BigInt>
725
726
// test for strings and bytes
727
if let Some(s) = obj.downcast_ref::<PyStr>() {
728
- return try_convert(s.borrow_value().as_bytes(), vm);
+ return try_convert(s.borrow_value().as_bytes(), vm, obj);
729
}
730
- if let Ok(r) = try_bytes_like(vm, &obj, |x| try_convert(x, vm)) {
+ if let Ok(r) = try_bytes_like(vm, &obj, |x| try_convert(x, vm, obj)) {
731
return r;
732
733
// strict `int` check
0 commit comments