(obj: &PyObject, lit: &[u8], vm: &VirtualMachine)
| 46 | |
| 47 | pub fn try_int(&self, vm: &VirtualMachine) -> PyResult<PyIntRef> { |
| 48 | fn try_convert(obj: &PyObject, lit: &[u8], vm: &VirtualMachine) -> PyResult<PyIntRef> { |
| 49 | let base = 10; |
| 50 | let digit_limit = vm.state.int_max_str_digits.load(); |
| 51 | |
| 52 | let i = bytes_to_int(lit, base, digit_limit) |
| 53 | .map_err(|e| handle_bytes_to_int_err(e, obj, vm))?; |
| 54 | Ok(PyInt::from(i).into_ref(&vm.ctx)) |
| 55 | } |
| 56 | |
| 57 | if let Some(i) = self.downcast_ref_if_exact::<PyInt>(vm) { |
| 58 | Ok(i.to_owned()) |
nothing calls this directly
no test coverage detected